Skip to content

Added markdown linting to pre-commit hooks #4975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
security-events: write
id-token: write
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
Expand All @@ -64,7 +63,6 @@ jobs:
run: |
cd doc/
sphinx-build -b html . _build

tests:
name: Linux tests
permissions:
Expand Down Expand Up @@ -125,7 +123,6 @@ jobs:
echo "sbom=false" >> $GITHUB_ENV
echo "sbom set to false"
fi

- name: Get date
id: get-date
run: |
Expand Down Expand Up @@ -184,7 +181,6 @@ jobs:
pytest -v --durations=50
test/test_cli.py
test/test_cvedb.py

long_tests:
name: Long tests on Python 3.13
permissions:
Expand Down Expand Up @@ -221,7 +217,6 @@ jobs:
echo "sbom=false" >> $GITHUB_ENV
echo "sbom set to false"
fi

- name: Get date
id: get-date
run: |
Expand Down Expand Up @@ -285,7 +280,7 @@ jobs:
--ignore=test/test_language_parser.py
- name: Upload code coverage to codecov
if: env.sbom != 'true'
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down Expand Up @@ -338,7 +333,6 @@ jobs:
echo "sbom=false" >> $GITHUB_ENV
echo "sbom set to false"
fi

- name: Get date
id: get-date
run: |
Expand Down Expand Up @@ -388,7 +382,7 @@ jobs:
test/test_language_scanner.py
- name: Upload code coverage to codecov
if: env.sbom != 'true'
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down Expand Up @@ -441,7 +435,6 @@ jobs:
echo "sbom=false" >> $GITHUB_ENV
echo "sbom set to false"
fi

- name: Get date
id: get-date
run: |
Expand Down Expand Up @@ -491,7 +484,7 @@ jobs:
test/test_scanner.py
- name: Upload code coverage to codecov
if: env.sbom != 'true'
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down Expand Up @@ -544,7 +537,6 @@ jobs:
echo "sbom=false" >> $GITHUB_ENV
echo "sbom set to false"
fi

- name: Get date
id: get-date
run: |
Expand Down Expand Up @@ -595,7 +587,7 @@ jobs:
test/test_cvedb.py
- name: Upload code coverage to codecov
if: env.sbom != 'true'
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down Expand Up @@ -653,6 +645,8 @@ jobs:
osv-vulnerabilities.storage.googleapis.com:443
packages.microsoft.com:443
playwright.azureedge.net:443
cdn.playwright.dev:443
playwright.download.prss.microsoft.com:443
ppa.launchpadcontent.net:443
pypi.org:443
release-monitoring.org:443
Expand All @@ -662,7 +656,6 @@ jobs:
storage.googleapis.com:443
www.cisa.gov:443
www.sqlite.org:443

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
Expand Down Expand Up @@ -718,6 +711,10 @@ jobs:
python -m pip install --upgrade wheel
python -m pip install --upgrade -r dev-requirements.txt
python -m pip install --editable .

- name: Set Playwright download host
run: echo "PLAYWRIGHT_DOWNLOAD_HOST=https://playwright.azureedge.net" >> $GITHUB_ENV

- name: Install playwright dependencies for HTML tests
run: |
python -m playwright install chromium --with-deps
Expand All @@ -744,7 +741,6 @@ jobs:
run: >
pytest -v --durations=0
test/test_json.py

windows_long_tests:
name: Windows long tests
permissions:
Expand Down Expand Up @@ -873,7 +869,7 @@ jobs:
-o junit_family=legacy
--durations=50
- name: Upload code coverage to codecov
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: coverage.xml
flags: windows_long_tests
Expand All @@ -888,4 +884,3 @@ jobs:
flags: windows_long_tests
files: junit.xml
fail_ci_if_error: false

10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ repos:
verbose: True
exclude: ^(locales|presentation|fuzz/generated|test|cve_bin_tool/checkers|build)
args: ["-vv", "-i", "-I", "-M", "-C", "-n", "-p", "-f", "60.0"]
# args for cut and paste: interrogate -vv -i -I -M -C -n -p -f 60.0

- repo: https://github.com/pycqa/isort
rev: 6.0.1
Expand Down Expand Up @@ -73,7 +72,7 @@ repos:
doc/.*|
test/test_data/.*|
test/__init__.py|
test/test_file.py|s
test/test_file.py|
test/test_requirements.py|
test/test_strings.py|
test/test_triage.py|
Expand All @@ -97,3 +96,10 @@ repos:
]
language: python
types: [text]

# ✅ Add Markdown Linter **without removing other linters**
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.44.0
hooks:
- id: markdownlint
args: ["--disable", "MD013", "MD033"] # Disable long lines & inline HTML rules
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.