frjo
August 31, 2023, 1:08pm
1
We are starting to enforce code styling with black, prettier and djhtml in Hypha.
The changes are not big but will touch many files. See PRs below.
We suggest other organisation run pre-commit run --all-files
on their code base before trying to merge in changes after PR #3547 are merged in to main.
HyphaApp:main
← HyphaApp:refractor/code-style
opened 11:08AM - 31 Aug 23 UTC
Add black and prettier check to lint
HyphaApp:main
← HyphaApp:code-formatting
opened 06:09PM - 30 Jul 23 UTC
- Add black, djhtml, prettier
- Add precommit
This PR add configurations f… or black, djhtml and prettier.
- black is used for formatting python files
- djhtml for formatting html files. Use `{# fmt: off #}` and `{# fmt: on #}` where needed.
- prettier for formatting of sass,css,yml and js files
Note: prettier picks up some of it's config from `.editorconfig`, so it's updated appropriately
Formating of mardown files, minified or vendored js files are ignored.
Formatting used off-the-self rules for better consistency with the community as large.
The formatting is not applied to all the files as it will introduce a lot of merge conflict with
current PRs, instead `pre-commit` config is provide which can be installed by `precommit install`
locally. It will format only the modified files in the PR/commits.
Once majority of the current active PRs are either rebased & formatted using precommit or merged, we can
run the `make fmt` on the full repo and activate additional prettier and black checks in our lint rules.
The modified sass files fixes the eslint error that would came up if we were to apply the prettier formatter on them.
Fixes #3500
frjo
September 8, 2023, 8:41am
2
This PR is now merged, time to run pre-commit run --all-files
and then rebase all your forks and PRs.