All checks were successful
continuous-integration/drone/push Build is passing
Its a better toml formatter that has better musl support, for when we move the images to alpine. Co-authored-by: Darragh Elliott <me@delliott.net> Reviewed-on: #5591 Reviewed-by: tobiasd <tobiasd@fsfe.org> Co-authored-by: delliott <delliott@fsfe.org> Co-committed-by: delliott <delliott@fsfe.org>
93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
pre-commit:
|
|
commands:
|
|
# FORMATTING, changes files
|
|
# Some filetypes must be formatted, and not being so will fail ci
|
|
ruff-check:
|
|
glob: "*.py"
|
|
run: ruff check --fix {staged_files}
|
|
stage_fixed: true
|
|
fail_on_changes: "ci"
|
|
ruff-format:
|
|
glob: "*.py"
|
|
run: ruff format {staged_files}
|
|
stage_fixed: true
|
|
fail_on_changes: "ci"
|
|
php-cs-fixer:
|
|
glob: "*.php"
|
|
run: php-cs-fixer --no-interaction --config=.php-cs-fixer.dist.php fix {staged_files}
|
|
stage_fixed: true
|
|
fail_on_changes: "ci"
|
|
shfmt:
|
|
glob: "*.sh"
|
|
run: shfmt --write {staged_files}
|
|
stage_fixed: true
|
|
fail_on_changes: "ci"
|
|
prettier:
|
|
glob:
|
|
- "*.css"
|
|
- "*.html"
|
|
- "*.js"
|
|
- "*.json"
|
|
- "*.less"
|
|
- "*.md"
|
|
- "*.scss"
|
|
- "*.yaml"
|
|
- "*.yml"
|
|
run: prettier --write {staged_files}
|
|
stage_fixed: true
|
|
tombi:
|
|
glob: "*.toml"
|
|
run: tombi format {staged_files}
|
|
stage_fixed: true
|
|
fail_on_changes: "ci"
|
|
format-xsl:
|
|
glob: "*.xsl"
|
|
run: for file in {staged_files}; do xmllint --format "$file" --output "$file"; done
|
|
stage_fixed: true
|
|
remove-empty-paragraphs:
|
|
glob:
|
|
- "*.xml"
|
|
- "*.xhtml"
|
|
run: for file in {staged_files}; do xsltproc --output "$file" ./tools/ci-checks/remove-empty-paragraphs.xsl "$file"; done
|
|
stage_fixed: true
|
|
|
|
# CHECKS, does not alter any files
|
|
reuse:
|
|
glob:
|
|
- "*.py"
|
|
run: reuse lint-file {staged_files}
|
|
pytest:
|
|
glob:
|
|
- "*.py"
|
|
run: pytest ./build/fsfe_website_build_tests_pre_commit
|
|
pyright:
|
|
glob: "*.py"
|
|
run: pyright {staged_files}
|
|
structure:
|
|
glob:
|
|
- "*.xml"
|
|
- "*.xhtml"
|
|
run: tools/ci-checks/compare-xml-structure.py {staged_files}
|
|
general:
|
|
glob:
|
|
- "*.html"
|
|
- "*.xml"
|
|
- "*.xhtml"
|
|
run: tools/ci-checks/general.sh {staged_files}
|
|
non-en-frontpage-news:
|
|
glob:
|
|
- "*.xml"
|
|
- "*.xhtml"
|
|
run: tools/ci-checks/check-non-en-frontpage.sh {staged_files}
|
|
simple-syntax:
|
|
glob:
|
|
- "*.xml"
|
|
- "*.xhtml"
|
|
- "*.xsl"
|
|
run: xmllint --noout {staged_files}
|
|
# for checks too slow to run all the time
|
|
ci-checks:
|
|
commands:
|
|
pytest:
|
|
run: pytest
|