cause the build to fail on lint errors #4053
Replies: 7 comments
-
|
Oh my! I am imagine moving to eleventy and using the inclusive language linter... |
Beta Was this translation helpful? Give feedback.
-
|
Ah I like this. @Ryuno-Ki not sure why the bad vibes here, it seems like it would need to be an optional feature (not all linter errors should fail) |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
I used the Inclusive Language Filter on downloaded tweets, which I have as part of the build. Yeah, would be cool if I could tell the linter to skip certain instances / directories (e.g. via frontmatter). |
Beta Was this translation helpful? Give feedback.
-
|
If anyone has figured out a workaround for this, it'd be good, I have an accessibility linter that I only run in CI that I'd like to fail my CI builds. 😄 Update: I ended up doing this, which is hacky but works for what I need. {
"scripts": {
"test:ci": "npm run test 2>&1 | tee -a /tmp/ci-output.txt; if grep -Fq 'Linter' /tmp/ci-output.txt; then exit 1; fi",
"test": "NODE_ENV=test eleventy"
}
}It runs the regular test, outputting both stdout and stderr to a temporary file. Then uses grep to look for the word 'Linter' and exits with a failing code if it does. You may need to change the word 'Linter' to something you're looking for. |
Beta Was this translation helpful? Give feedback.
-
|
FWIW: Normally, a CI (like CircleCI) wouldn't allow you to write to a system environment (I think). Thus, you would use |
Beta Was this translation helpful? Give feedback.
-
|
@Ryuno-Ki good note, I think potentially because GitHub Actions is spinning it's own instance of Ubuntu you can use that temp folder. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
The linter capability is extremely cool, but I'd ideally like to force the build to be lint clean, i.e. for eleventy to fail if a linter detects a problem.
Describe the solution you'd like
Either return codes for linter functions or APIs for linters to invoke e.g.:
Describe alternatives you've considered
The linter could just exit the process, but that seems extreme.
Beta Was this translation helpful? Give feedback.
All reactions