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

Add none reporter and option to hide file header for better in editor support #372

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rrothenberger
Copy link

@rrothenberger rrothenberger commented Sep 6, 2024

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-header which will prevent outputting this line:

================ /path/to/file.html.erb ==================

Naming is hard, so more than happy to adjust naming.

Example:
image

There is another PR with similar changes: #357, the main differences are:

  • none reporter 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.
  • I didn't want to change behavior of all cli outputs by setting --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 use erb_lint with conform, just not through stdin, example configuration:

    formatters = {
      erb_lint = {
        stdin = false,
        tmpfile_format = ".conform.$RANDOM.$FILENAME",
        command = "bundle",
        args = { "exec", "erblint", "--autocorrect", "$FILENAME" },
      },
    },

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

Successfully merging this pull request may close these issues.

1 participant