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

Add HTML formatting and linting to pre-commit #239

Closed
redshiftzero opened this issue Apr 10, 2017 · 5 comments · Fixed by #966 or #968
Closed

Add HTML formatting and linting to pre-commit #239

redshiftzero opened this issue Apr 10, 2017 · 5 comments · Fixed by #966 or #968
Assignees

Comments

@redshiftzero
Copy link
Member

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! ✨

@jrabbit
Copy link
Contributor

jrabbit commented Dec 17, 2018

https://github.com/motet-a/jinjalint exists but doesn't seem too robust
update: it seems to run fine as does html-linter

@abandoned-prototype
Copy link
Collaborator

Now that we use pre-commit adding an html template linter should be relatively easy and pretty helpful

@michplunkett
Copy link
Collaborator

michplunkett commented Jul 7, 2023

It doesn't look like jinjalint is being maintained, but djlint is: https://www.djlint.com/docs/languages/jinja/

We could likely implement this pretty easily.

@michplunkett michplunkett linked a pull request Jul 10, 2023 that will close this issue
3 tasks
@michplunkett michplunkett changed the title Add HTML linting to CI Add HTML formatting and linting to CI Jul 11, 2023
@michplunkett
Copy link
Collaborator

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.

@michplunkett michplunkett linked a pull request Jul 12, 2023 that will close this issue
3 tasks
@michplunkett michplunkett changed the title Add HTML formatting and linting to CI Add HTML formatting and linting to pre-commit Jul 12, 2023
michplunkett added a commit that referenced this issue Jul 12, 2023
## 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 % 
```
@michplunkett michplunkett reopened this Jul 12, 2023
@michplunkett
Copy link
Collaborator

The HTML formatting part is done, but the linting is not.

michplunkett added a commit that referenced this issue Jul 13, 2023
## 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.
sea-kelp pushed a commit to OrcaCollective/OpenOversight that referenced this issue Sep 6, 2023
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 %
```
sea-kelp pushed a commit to OrcaCollective/OpenOversight that referenced this issue Sep 6, 2023
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.
sea-kelp pushed a commit to OrcaCollective/OpenOversight that referenced this issue Sep 25, 2023
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 %
```
sea-kelp pushed a commit to OrcaCollective/OpenOversight that referenced this issue Sep 25, 2023
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.
sea-kelp pushed a commit to OrcaCollective/OpenOversight that referenced this issue Oct 5, 2023
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 %
```
sea-kelp pushed a commit to OrcaCollective/OpenOversight that referenced this issue Oct 5, 2023
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.
AetherUnbound pushed a commit to OrcaCollective/OpenOversight that referenced this issue Oct 9, 2023
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 %
```
AetherUnbound pushed a commit to OrcaCollective/OpenOversight that referenced this issue Oct 9, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants