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

lint and prettify on PR push/change #465

Merged
merged 4 commits into from
Dec 5, 2024
Merged

lint and prettify on PR push/change #465

merged 4 commits into from
Dec 5, 2024

Conversation

echo-bravo-yahoo
Copy link
Contributor

@echo-bravo-yahoo echo-bravo-yahoo commented Dec 4, 2024

this change updates the linting github action to fail if prettier or eslint suggest any changes.

to make this manageable, this change also adds a husky hook that runs on commit and re-formats and lints (without committing the resulting changes). this should help keep the codebase consistently prettified.

@echo-bravo-yahoo echo-bravo-yahoo requested a review from a team as a code owner December 4, 2024 20:37
@echo-bravo-yahoo echo-bravo-yahoo force-pushed the pretty-lint branch 6 times, most recently from 69721ce to 93b2501 Compare December 4, 2024 21:17
@echo-bravo-yahoo echo-bravo-yahoo marked this pull request as draft December 4, 2024 21:21
@echo-bravo-yahoo echo-bravo-yahoo force-pushed the pretty-lint branch 2 times, most recently from ea48a47 to 231a742 Compare December 4, 2024 21:47
@echo-bravo-yahoo echo-bravo-yahoo marked this pull request as ready for review December 4, 2024 21:49
Comment on lines -27 to -31
env:
TERM: xterm-256color
# Set to the correct color level; 2 is 256 colors
# https://github.com/chalk/chalk?tab=readme-ov-file#supportscolor
FORCE_COLOR: 2
Copy link
Contributor Author

@echo-bravo-yahoo echo-bravo-yahoo Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was copied from the tests (where it's relevant for the test runner), but isn't needed here, so i'm removing it. this job has color support & the linter detects it:
image

@@ -73,11 +73,13 @@
"test": "npm run test:local",
"test:local": "mocha --recursive ./test --require ./test/mocha-root-hooks.mjs --reporter mocha-multi-reporters --reporter-options configFile=./test/config/reporter.json",
"pretest:ci": "npm run build:app",
"test:ci": "mocha --recursive ./test --require ./test/mocha-root-hooks.mjs --reporter mocha-multi-reporters --reporter-options configFile=./test/config/reporter.json",
"test:ci": "mocha --forbid-only --recursive ./test --require ./test/mocha-root-hooks.mjs --reporter mocha-multi-reporters --reporter-options configFile=./test/config/reporter.json",
Copy link
Contributor Author

@echo-bravo-yahoo echo-bravo-yahoo Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI test runs now fail if they encounter any usages of .only(...). Local test runs allow .only(...) for easier debugging.

echo-bravo-yahoo and others added 4 commits December 4, 2024 16:14
this change updates the linting github action to commit the changes that
prettier causes. this will keep the codebase consistently prettified
without requiring client-side git hooks. it could also commit linting
changes (by running `npm run lint --fix`), but this PR does not enable
that out of an abundance of caution for the changes the linter might
introduce.
@echo-bravo-yahoo echo-bravo-yahoo merged commit e3dd92e into v3 Dec 5, 2024
4 checks passed
@echo-bravo-yahoo echo-bravo-yahoo deleted the pretty-lint branch December 5, 2024 00:15
@cleve-fauna cleve-fauna mentioned this pull request Dec 5, 2024
This was referenced Dec 6, 2024
@cleve-fauna cleve-fauna mentioned this pull request Dec 13, 2024
@wildemat wildemat mentioned this pull request Dec 18, 2024
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.

3 participants