Skip to content

Commit 17683c8

Browse files
evan-goodedcantrell
authored andcommitted
[ci] Replace tox CI job with pre-commit
tox and pre-commit have distinct use cases, for instance tox is good for running tests against a variety of Python versions. But it seems like rpminspect only uses it for linting, so I ripped it out in favor of pre-commit so that the linting process is the same on the developer side and on the CI side. Signed-off-by: Evan Goode <[email protected]>
1 parent 3c4da2c commit 17683c8

File tree

4 files changed

+15
-58
lines changed

4 files changed

+15
-58
lines changed

.github/workflows/pre-commit.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- uses: pre-commit/[email protected]

.github/workflows/python.yml

-31
This file was deleted.

.pre-commit-config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ repos:
1111
rev: 6.1.0
1212
hooks:
1313
- id: flake8
14-
args: ["--extend-ignore=E501"]

tox.ini

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
1-
[tox]
2-
envlist = flake8,format
3-
skipsdist=True
4-
5-
[testenv]
6-
# Fiddle with the base python definitions so the Github CI matrix works neatly
7-
basepython =
8-
py3.8: python3.8
9-
py38: python3.8
10-
sitepackages = False
11-
12-
[testenv:flake8]
13-
basepython = python3.8
14-
deps =
15-
flake8 == 6.1.0
16-
commands =
17-
python -m flake8 {posargs}
18-
19-
[testenv:format]
20-
basepython = python3.8
21-
deps =
22-
black == 23.9.1
23-
commands =
24-
python -m black --check --diff {posargs:.}
25-
261
[flake8]
272
basepython = python3.8
283
show-source = True
29-
max-line-length = 100
304
exclude = .git,.tox,dist,*egg,contrib/
5+
extend-ignore = E501

0 commit comments

Comments
 (0)