danger-ruby-swiftlint
danger-ruby-swiftlint copied to clipboard
[Feature Request] Non-commenting option
- I've hit up against another issue extending the functionality of this plugin, and have a proposal to allow generic handling of violations by callers.
- Similar to this issue: https://github.com/ashfurrow/danger-ruby-swiftlint/issues/125 , I want to modify/filter or send violations somewhere else. In this case, I want all the violations to be in a single Github Review comment.
- Instead of adding another small extension to support this case, I'd like to propose the following:
- Removing the existing
select
issues block from thelint_files
method - Adding a parameter that prevents this plugin from commenting. Maybe
dry_run
orno_comment
? - This would allow an external caller of this plugin to assume complete control over the values set in the
warnings
anderror
attr_accessors
- Removing the existing
E.g.
# Run swiftlint
swiftlint.lint_files(dry_run: true)
swiftlint_warnings = swiftlint.warnings
swiftlint_errors = swiftlint.errors
# Filter warnings + errors here
filtered_warnings = swiftlint_warnings.select(&filter_warnings)
filtered_errors = swiftlint_errors.select(&filter_errors)
# Create GH review
github.review.start
#TODO: Add all the warnings + errors here.
github.review.submit
Thoughts? I can work on an implementation that makes sense if this seems reasonable.
Hey, yeah that makes sense! I'd say the argument should be no_comment
👍