-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add --lenient
CLI option to lint
command
#1364
Conversation
see #1359 for previous discussion |
newest danger release appears to be hanging |
Generated by 🚫 danger |
@marcelofabri the CI issue is resolved |
CHANGELOG.md
Outdated
@@ -3,136 +3,141 @@ | |||
##### Breaking | |||
|
|||
* `variable_name` rule (`VariableNameRule`) is now `identifier_name` | |||
(`IdentifierNameRule`) as it validates other identifiers as well. | |||
(`IdentifierNameRule`) as it validates other identifiers as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the trailing whitespace shouldn't be removed
@@ -137,6 +150,8 @@ struct LintOptions: OptionsProtocol { | |||
<*> mode <| configOption | |||
<*> mode <| Option(key: "strict", defaultValue: false, | |||
usage: "fail on warnings") | |||
<*> mode <| Option(key: "lenient", defaultValue: false, | |||
usage: "succeed on errors") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should have a better description, since it's not the only thing that this option does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"downgrades serious violations to warnings, and any warning threshold is disabled"
return violations | ||
} | ||
return violations.map { | ||
$0.severity == .error ? StyleViolation(ruleDescription: $0.ruleDescription, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you split this into an if
statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see updates for review
@@ -137,6 +150,8 @@ struct LintOptions: OptionsProtocol { | |||
<*> mode <| configOption | |||
<*> mode <| Option(key: "strict", defaultValue: false, | |||
usage: "fail on warnings") | |||
<*> mode <| Option(key: "lenient", defaultValue: false, | |||
usage: "succeed on errors") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"downgrades serious violations to warnings, and any warning threshold is disabled"
Codecov Report
@@ Coverage Diff @@
## master #1364 +/- ##
=========================================
- Coverage 81.91% 81.8% -0.12%
=========================================
Files 181 181
Lines 9076 9089 +13
=========================================
Hits 7435 7435
- Misses 1641 1654 +13
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done pending a change to help text
Thanks for the patience! |
Hmm this isn't working for me This is the end of the script:
Somehow it says it found 0 serious violations, even though it did emit errors:
Note that I obviously don't use semicolons, this is just a test 😅 |
@NachoSoto can you please open an issue to track this? |
Looks like wrt Xcode builds I needed to do more than suppress severity and correct return status. Our use case is running this on a server. outside of Xcode so I didn't see this case. Need to suppress emitting of Xcode errors I think. |
looks like the issue is
fix should be
|
or something similar. |
No description provided.