mirror of
https://github.com/mandiant/capa.git
synced 2026-01-03 16:27:58 -08:00
ci: use pre-commit to invoke linters
This commit is contained in:
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
@@ -34,15 +34,15 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pip install -e .[dev]
|
||||
- name: Lint with ruff
|
||||
run: ruff check --config .github/ruff.toml .
|
||||
run: pre-commit run ruff
|
||||
- name: Lint with isort
|
||||
run: isort --profile black --length-sort --line-width 120 --skip-glob "*_pb2.py" -c .
|
||||
run: pre-commit run isort
|
||||
- name: Lint with black
|
||||
run: black -l 120 --extend-exclude ".*_pb2.py" --check .
|
||||
- name: Lint with pycodestyle
|
||||
run: pycodestyle --exclude="*_pb2.py" --show-source capa/ scripts/ tests/
|
||||
run: pre-commit run black
|
||||
- name: Lint with flake8
|
||||
run: pre-commit run flake8
|
||||
- name: Check types with mypy
|
||||
run: mypy --config-file .github/mypy/mypy.ini --check-untyped-defs capa/ scripts/ tests/
|
||||
run: pre-commit run mypy
|
||||
|
||||
rule_linter:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -56,9 +56,9 @@ jobs:
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Install capa
|
||||
run: pip install -e .
|
||||
run: pip install -e .[dev]
|
||||
- name: Run rule linter
|
||||
run: python scripts/lint.py rules/
|
||||
run: pre-commit run rule-linter
|
||||
|
||||
tests:
|
||||
name: Tests in ${{ matrix.python-version }} on ${{ matrix.os }}
|
||||
|
||||
Reference in New Issue
Block a user