Add none reporter and option to hide file header for better in editor support#372
Closed
rrothenberger wants to merge 3 commits intoShopify:mainfrom
Closed
Add none reporter and option to hide file header for better in editor support#372rrothenberger wants to merge 3 commits intoShopify:mainfrom
rrothenberger wants to merge 3 commits intoShopify:mainfrom
Conversation
| if stdin? && autocorrect? | ||
| # When running from stdin, we only lint a single file | ||
| puts "================ #{lint_files.first} ==================\n" | ||
| puts "================ #{lint_files.first} ==================\n" unless @options[:no_file_header] |
There was a problem hiding this comment.
Rather than introducing a new option, can we just assume that when the 'none' reporter is being used, we ignore the header?
Member
|
Can you check whether #393 would work for you? I think it should. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey 👋
The goal of this PR is to make it easier to use this great tool within editors, for example using it with conform. It does that by adding a new reporter:
none, which will prevent reporting any linter output to stdout, and by adding flag--no-file-headerwhich will prevent outputting this line:Naming is hard, so more than happy to adjust naming.
Example:

There is another PR with similar changes: #357, the main differences are:
nonereporter just does not output anything instead of moving the lining logs into stderr, as I was afraid it might still be read by some editors.--format- personally wouldn't expect that from the CLI, so instead I decided to add new flag that disabled the file header from above.I skipped specs for the reporter itself, as this just prevents outputs.
If someone found this out looking for solution for
conform- even if this is not merged, you still can useerb_lintwith conform, just not through stdin, example configuration: