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

[FR]: add optional tags that result in warning / errors for linting issues during normal builds #481

Open
antspy opened this issue Feb 14, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@antspy
Copy link

antspy commented Feb 14, 2025

What is the current behavior?

Right now Linting is meant to be used purely as a code review tool - it’s meant to be run during CI and present the findings as PR comments

Describe the feature

I propose adding the ability to specify if linting issues should also be raised as warnings or errors during normal bazel builds.

Proposed approach is to modify the aspect cli so that it looks for optional tags in each build target (tag = “lint-as-warning” or “lint-as-errors”) and then:

  • for warnings, it would print linting issues to stdout during the build, so that they are clearly visible by the user as you’re building locally
  • for errors, the same happens, but linting errors also fail the build

We could also add a generic config option to the .aspect/cli/config.yaml so that user can set their own global defaults, in case you don’t want to change every target

Do you think such a feature makes sense?
I understand the philosophy of having linting be independent on the build, but sometimes you do want to enforce linting rules (most notably, nextJS does that by default) and this seems like a relatively clean way of integrating linting issues into the workflow.

Let me know what you think!

@antspy antspy added the enhancement New feature or request label Feb 14, 2025
@antspy antspy changed the title [FR]: add optional tags that result in warning / errors [FR]: add optional tags that result in warning / errors for linting issues Feb 14, 2025
@antspy antspy changed the title [FR]: add optional tags that result in warning / errors for linting issues [FR]: add optional tags that result in warning / errors for linting issues during normal builds Feb 14, 2025
@alexeagle
Copy link
Member

@antspy
Copy link
Author

antspy commented Feb 22, 2025

Ah that looks really cool, thanks a lot! I had indeed missed it :)

Is there a way to do the same, but enabling them as warning? e.g. messages displayed (in yellow) during bazel build, which do not fail the build, but keep you aware of the linting issues?

Also, there might be some value in specifying per-target config (e.g. I only want lint issues to fail this target, but all of them by default, or something like that).

In any case, this looks really cool, thank you! Will use that for now :)

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

No branches or pull requests

2 participants