Skip to content
This repository was archived by the owner on Jun 19, 2022. It is now read-only.

Latest commit

 

History

History
75 lines (53 loc) · 2.01 KB

File metadata and controls

75 lines (53 loc) · 2.01 KB

Code style

Python code should follow Black's style.

HTML/CSS must pass w3's validators, and if they don't it's a TODO/bug. Unless of course the errors refer to newer standards that haven't been implemented in the validator yet.

Commit subjects should be written in imperative mood for consistency and clarity.

Running validators / formatters

python, pylint

Uses .pylintrc.

pylint -E  tade/*py tade/views/*py

python, black

black tade/*py

django templates, djhtml

git add tade/templates/TEMPL.html # stage first
djhtml -i tade/templates/TEMPL.html # in-place formatting
git add -p tade/templates/TEMPL.html # selectively add formatting if acceptable

HTML, vnu.jar

vnu.jar "http://127.0.0.1:8002/"

Recursive check with tools/recursive_html_validate.py:

python3 tools/recursive_html_validate.py "127.0.0.1:8002" # no login
python3 tools/recursive_html_validate.py --login --username superuser@website.tld --password "password" "127.0.0.1:8002"
usage: recursive_html_validate.py [-h] [--login] [--check-xml]
                                  [--vnu-jar-bin VNU_JAR_BIN] [-u USERNAME]
                                  [-p PASSWORD]
                                  url

positional arguments:
  url

optional arguments:
  -h, --help            show this help message and exit
  --login               login before scraping? (html and valid endpoints are
                        different when authenticated
  --check-xml           also check XML (feeds)
  --vnu-jar-bin VNU_JAR_BIN
  -u USERNAME, --username USERNAME
  -p PASSWORD, --password PASSWORD

Broken links, checklink

checklink --broken --quiet --indicator --summary --recursive --location "http://127.0.0.1:8000" "http://127.0.0.1:8000/"

CSS, css-validator.jar

css-validator.jar "http://127.0.0.1:8002/static/style.css"