Skip to content

Lucas-C/pre-commit-hooks-lxml

Repository files navigation

build status Known Vulnerabilities

Useful pre-commit hooks to check your CSS / HTML pages / templates.

Usage

-   repo: https://github.com/Lucas-C/pre-commit-hooks-lxml
    rev: v1.1.1
    hooks:
    -   id: forbid-html-img-without-alt-text
    -   id: forbid-non-std-html-attributes
    -   id: detect-missing-css-classes
        args:
        - --css-files-dir
        - css/
        - --css-lib-files-dir
        - vendors/
        - --html-files-dir
        - html/
    -   id: html-tags-blacklist
    -   id: html-attributes-blacklist

[FR] Accessibilité RGAA

Les hooks html-tags-blacklist & html-attributes-blacklist sont configurés par défaut pour interdire les élements et attributs nuisant à l'accessibilité, selon les recommendations d'Access42.

cf. issue #2

Dependencies needed to use lxml

Under Cygwin, with apt-cyg:

apt-cyg install git python3 gcc-g++ python3-devel libxml2-devel libxslt-devel

With MSYS2 :

pacman -S git python3 gcc python3-devel libxml2-devel libxslt-devel tar

The package names must be very similar under Linux.

Development

Setup

pip install -e .
pip install -U -r dev-requirements.txt
pre-commit install

Releasing

  1. Bump version in setup.py and in all occurences of rev: in this README.md file.
  2. git commit -nam "Release $version" && git push && git tag $version && git push --tags
  3. Create a GitHub release

About

Some HTML validating hooks using lxml for pre-commit

Topics

Resources

License

Stars

6 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages