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 Request] Non-commenting option #129

Open
daniel-beard opened this issue Apr 25, 2019 · 1 comment
Open

[Feature Request] Non-commenting option #129

daniel-beard opened this issue Apr 25, 2019 · 1 comment

Comments

@daniel-beard
Copy link
Contributor

  • 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: Filter out non-inline violations? #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 the lint_files method
    • Adding a parameter that prevents this plugin from commenting. Maybe dry_run or no_comment ?
    • This would allow an external caller of this plugin to assume complete control over the values set in the warnings and error attr_accessors

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.

@ashfurrow
Copy link
Owner

Hey, yeah that makes sense! I'd say the argument should be no_comment 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants