Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add support for multiple makefiles #70

Merged
Merged
Prev Previous commit
Next Next commit
Implement FileName struct member for MinPhony rule + tests
  • Loading branch information
trinitronx committed Apr 28, 2022
commit 7063e813d23305a83ea2e8d8e27b6d90141a8e45
1 change: 1 addition & 0 deletions rules/minphony/minphony.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (r *MinPhony) Run(makefile parser.Makefile, _ rules.RuleConfig) rules.RuleV
ret = append(ret, rules.RuleViolation{
Rule: "minphony",
Violation: fmt.Sprintf("Missing required phony target %q", reqRule),
FileName: makefile.FileName,
LineNumber: ruleLineNumber,
})
}
Expand Down
6 changes: 6 additions & 0 deletions rules/minphony/minphony_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var mpRunTests = []struct {
}{
{
mf: parser.Makefile{
FileName: "green-eggs.mk",
Rules: parser.RuleList{
{Target: "green-eggs"},
{Target: "ham"},
Expand All @@ -26,22 +27,26 @@ var mpRunTests = []struct {
rules.RuleViolation{
Rule: "minphony",
Violation: "Missing required phony target \"kleen\"",
FileName: "green-eggs.mk",
LineNumber: -1,
},
rules.RuleViolation{
Rule: "minphony",
Violation: "Missing required phony target \"awl\"",
FileName: "green-eggs.mk",
LineNumber: -1,
},
rules.RuleViolation{
Rule: "minphony",
Violation: "Missing required phony target \"toast\"",
FileName: "green-eggs.mk",
LineNumber: -1,
},
},
},
{
mf: parser.Makefile{
FileName: "kleen.mk",
Rules: parser.RuleList{
{Target: "awl"},
{Target: "distkleen"},
Expand All @@ -55,6 +60,7 @@ var mpRunTests = []struct {
rules.RuleViolation{
Rule: "minphony",
Violation: "Missing required phony target \"toast\"",
FileName: "kleen.mk",
LineNumber: -1,
},
},
Expand Down