-
Notifications
You must be signed in to change notification settings - Fork 79
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 HTML formatting and linting to pre-commit
#239
Comments
https://github.com/motet-a/jinjalint exists but doesn't seem too robust |
Now that we use pre-commit adding an html template linter should be relatively easy and pretty helpful |
It doesn't look like We could likely implement this pretty easily. |
This is gonna be split up into two PRs, one formatting and one for linting. Since the changes to the HTML, JS, and CSS will be so vast for just the formatting, no reviewer will actually be able to see the code that is changed for formatting as opposed to linting. |
pre-commit
## Fixes issue #239 ## Description of Changes Added [`djLint`](https://www.djlint.com/docs/languages/jinja/) to the `pre-commit` process and formatted files accordingly. ## Tests and linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. `pre-commit` output: ```console (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % make lint pre-commit run --all-files trim trailing whitespace.................................................Passed check docstring is first.................................................Passed check that executables have shebangs.....................................Passed check json...............................................................Passed check for case conflicts.................................................Passed check toml...........................................(no files to check)Skipped check for merge conflicts................................................Passed check xml................................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed check for broken symlinks............................(no files to check)Skipped mixed line ending........................................................Passed fix python encoding pragma...............................................Passed pretty format json.......................................................Passed fix requirements.txt.....................................................Passed check blanket noqa.......................................................Passed check for not-real mock methods..........................................Passed check for eval().........................................................Passed use logger.warning(......................................................Passed Run isort to sort imports................................................Passed Run pydocstyle...........................................................Passed Do not use shebangs in non-executable files..............................Passed flake8...................................................................Passed black....................................................................Passed djLint formatting........................................................Passed (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % ```
The HTML formatting part is done, but the linting is not. |
## Fixes issue #239 ## Description of Changes I added `djlint` linting to the `pre-commit` script and made the corresponding changes. ## Tests and linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#239 Added [`djLint`](https://www.djlint.com/docs/languages/jinja/) to the `pre-commit` process and formatted files accordingly. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. `pre-commit` output: ```console (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % make lint pre-commit run --all-files trim trailing whitespace.................................................Passed check docstring is first.................................................Passed check that executables have shebangs.....................................Passed check json...............................................................Passed check for case conflicts.................................................Passed check toml...........................................(no files to check)Skipped check for merge conflicts................................................Passed check xml................................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed check for broken symlinks............................(no files to check)Skipped mixed line ending........................................................Passed fix python encoding pragma...............................................Passed pretty format json.......................................................Passed fix requirements.txt.....................................................Passed check blanket noqa.......................................................Passed check for not-real mock methods..........................................Passed check for eval().........................................................Passed use logger.warning(......................................................Passed Run isort to sort imports................................................Passed Run pydocstyle...........................................................Passed Do not use shebangs in non-executable files..............................Passed flake8...................................................................Passed black....................................................................Passed djLint formatting........................................................Passed (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % ```
lucyparsons#239 I added `djlint` linting to the `pre-commit` script and made the corresponding changes. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#239 Added [`djLint`](https://www.djlint.com/docs/languages/jinja/) to the `pre-commit` process and formatted files accordingly. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. `pre-commit` output: ```console (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % make lint pre-commit run --all-files trim trailing whitespace.................................................Passed check docstring is first.................................................Passed check that executables have shebangs.....................................Passed check json...............................................................Passed check for case conflicts.................................................Passed check toml...........................................(no files to check)Skipped check for merge conflicts................................................Passed check xml................................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed check for broken symlinks............................(no files to check)Skipped mixed line ending........................................................Passed fix python encoding pragma...............................................Passed pretty format json.......................................................Passed fix requirements.txt.....................................................Passed check blanket noqa.......................................................Passed check for not-real mock methods..........................................Passed check for eval().........................................................Passed use logger.warning(......................................................Passed Run isort to sort imports................................................Passed Run pydocstyle...........................................................Passed Do not use shebangs in non-executable files..............................Passed flake8...................................................................Passed black....................................................................Passed djLint formatting........................................................Passed (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % ```
lucyparsons#239 I added `djlint` linting to the `pre-commit` script and made the corresponding changes. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#239 Added [`djLint`](https://www.djlint.com/docs/languages/jinja/) to the `pre-commit` process and formatted files accordingly. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. `pre-commit` output: ```console (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % make lint pre-commit run --all-files trim trailing whitespace.................................................Passed check docstring is first.................................................Passed check that executables have shebangs.....................................Passed check json...............................................................Passed check for case conflicts.................................................Passed check toml...........................................(no files to check)Skipped check for merge conflicts................................................Passed check xml................................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed check for broken symlinks............................(no files to check)Skipped mixed line ending........................................................Passed fix python encoding pragma...............................................Passed pretty format json.......................................................Passed fix requirements.txt.....................................................Passed check blanket noqa.......................................................Passed check for not-real mock methods..........................................Passed check for eval().........................................................Passed use logger.warning(......................................................Passed Run isort to sort imports................................................Passed Run pydocstyle...........................................................Passed Do not use shebangs in non-executable files..............................Passed flake8...................................................................Passed black....................................................................Passed djLint formatting........................................................Passed (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % ```
lucyparsons#239 I added `djlint` linting to the `pre-commit` script and made the corresponding changes. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#239 Added [`djLint`](https://www.djlint.com/docs/languages/jinja/) to the `pre-commit` process and formatted files accordingly. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. `pre-commit` output: ```console (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % make lint pre-commit run --all-files trim trailing whitespace.................................................Passed check docstring is first.................................................Passed check that executables have shebangs.....................................Passed check json...............................................................Passed check for case conflicts.................................................Passed check toml...........................................(no files to check)Skipped check for merge conflicts................................................Passed check xml................................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed check for broken symlinks............................(no files to check)Skipped mixed line ending........................................................Passed fix python encoding pragma...............................................Passed pretty format json.......................................................Passed fix requirements.txt.....................................................Passed check blanket noqa.......................................................Passed check for not-real mock methods..........................................Passed check for eval().........................................................Passed use logger.warning(......................................................Passed Run isort to sort imports................................................Passed Run pydocstyle...........................................................Passed Do not use shebangs in non-executable files..............................Passed flake8...................................................................Passed black....................................................................Passed djLint formatting........................................................Passed (openoversight) xxxxxx@MacBook-Air-5 OpenOversight % ```
lucyparsons#239 I added `djlint` linting to the `pre-commit` script and made the corresponding changes. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
Once we find a good linter for HTML, we should add it to CI.
I was using bootlint and html-linter using the
--disable=optional_tag,protocol
options to clean up some of the HTML in #238.If there's something better out there please comment and let us know! ✨
The text was updated successfully, but these errors were encountered: