Skip to content

[Feature Request] Non-commenting option #129

Description

@daniel-beard
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions