docs(sphinx-lint): Add sphinx-lint to pre-commit, GH and GL pipelines

This commit is contained in:
Jan Beran
2024-02-12 16:28:43 +01:00
parent 80304e6b62
commit 1de1a2659f
4 changed files with 10 additions and 14 deletions

View File

@@ -69,8 +69,7 @@ jobs:
- name: Checkout
uses: actions/checkout@master
- name: Lint and format with ruff
- name: Run pre-commit hooks
run: |
pip install --extra-index-url https://dl.espressif.com/pypi -e .[dev]
python -m ruff check
python -m ruff format
pre-commit run --all-files

View File

@@ -119,22 +119,14 @@ host_tests_hsm:
script:
- coverage run --parallel-mode -m pytest ${CI_PROJECT_DIR}/test/test_espsecure_hsm.py
check_python_style:
run_pre_commit_hooks:
stage: test
image: python:3.7-bullseye
tags:
- host_test
artifacts:
reports:
codequality: code_quality_report.json
when: on_failure
script:
# This step installs any 'dev' dependencies (ie ruff)
# The runner should cache the downloads, so still quite fast.
- pip install -e .[dev] --prefer-binary
- python -m ruff check --exit-zero --output-format=gitlab --output-file=code_quality_report.json
- python -m ruff check
- python -m ruff format
- pre-commit run --all-files
.run_esptool: &run_esptool |
esptool.py --help

View File

@@ -5,6 +5,12 @@ repos:
- id: ruff # Runs ruff linter (replaces flake8)
args: [--fix, --exit-non-zero-on-fix] # --fix for fixing errors
- id: ruff-format
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.6.8
hooks:
- id: sphinx-lint
name: Lint RST files in docs folder using Sphinx Lint
files: ^((docs/en)/.*\.(rst|inc))|CONTRIBUTING.rst$
- repo: https://github.com/espressif/conventional-precommit-linter
rev: v1.4.0
hooks:

View File

@@ -108,7 +108,6 @@ setup(
setup_requires=(["wheel"] if "bdist_wheel" in sys.argv else []),
extras_require={
"dev": [
"ruff>=0.1.14",
"pyelftools",
"coverage~=6.0",
"pre-commit",