1d0acdf389
continuous-integration/drone/push Build is passing
Require 100% line coverage for lib functions. At present we only test lib functions. Add the tests needed to achieve this coverage. --------- Co-authored-by: Darragh Elliott <me@delliott.net> Reviewed-on: #5839 Co-authored-by: delliott <420+delliott@fsfe.org> Co-committed-by: delliott <420+delliott@fsfe.org>
83 lines
2.1 KiB
YAML
83 lines
2.1 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: coverage run -m pytest ./build/fsfe_website_build_tests_pre_commit
|
|
pytest-coverage:
|
|
glob:
|
|
- "*.py"
|
|
run: coverage report --show-missing --fail-under=85
|
|
ty:
|
|
glob: "*.py"
|
|
run: ty check {staged_files}
|
|
general-checks:
|
|
run: tools/ci-checks/run_checks.py {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
|