Skip to content

Commit 94dd48a

Browse files
Add linting CLI (#26)
--------- Co-authored-by: always-on-duty[bot] <120557446+always-on-duty[bot]@users.noreply.github.com>
1 parent 7e68604 commit 94dd48a

22 files changed

+752
-778
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ name: Docker
77

88
on:
99
schedule:
10-
- cron: '19 14 * * *'
10+
- cron: "25 14 * * *"
1111
push:
1212
branches: [ "master" ]
1313
# Publish semver tags as releases.
14-
tags: [ 'v*.*.*' ]
14+
tags: [ "v*.*.*" ]
1515
pull_request:
1616
branches: [ "master" ]
1717

@@ -35,7 +35,7 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
3939

4040
# Install the cosign tool except on PR
4141
# https://github.com/sigstore/cosign-installer
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Freeze PR dependency changes
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- master
11+
paths: ["piped", "pyproject.toml", "requirements.in", "dev-requirements/*.in", "!dev-requirements/constraints.in"]
12+
13+
jobs:
14+
freeze-pr-dep-changes:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
19+
with:
20+
submodules: "true"
21+
22+
- name: Set up Python 3.11
23+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
24+
with:
25+
python-version: "3.11"
26+
27+
- name: install prerequisites
28+
run: |
29+
python -m pip install --upgrade pip wheel
30+
python -m pip install -r ./piped/python/base-requirements/nox.txt
31+
32+
- name: Upgrade dependency locks
33+
run: python -m nox -s freeze-locks bot-package-diff
34+
35+
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
36+
with:
37+
name: gogo.patch
38+
path: gogo.patch
39+
40+
- name: Check diff file
41+
run: python -m nox -s is-diff-file-empty

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Lint
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
branches:
13+
- master
14+
schedule:
15+
- cron: "0 12 * * 6"
16+
workflow_dispatch:
17+
18+
jobs:
19+
lint:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
24+
with:
25+
submodules: "true"
26+
27+
- name: Set up Python 3.11
28+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
29+
with:
30+
python-version: "3.11"
31+
32+
- name: install prerequisites
33+
run: |
34+
python -m pip install --upgrade pip wheel
35+
python -m pip install -r ./piped/python/base-requirements/nox.txt
36+
37+
- name: Check spelling
38+
run: python -m nox -s spell-check
39+
40+
- name: Lint with flake8
41+
run: python -m nox -s flake8

.github/workflows/reformat.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Reformat PR code
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
reformat:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
18+
with:
19+
submodules: "true"
20+
21+
- name: Set up Python 3.11
22+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
23+
with:
24+
python-version: "3.11"
25+
26+
- name: install prerequisites
27+
run: |
28+
python -m pip install --upgrade pip wheel
29+
python -m pip install -r ./piped/python/base-requirements/nox.txt
30+
31+
- name: Reformat
32+
run: python -m nox -s reformat bot-package-diff
33+
34+
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
35+
with:
36+
name: gogo.patch
37+
path: gogo.patch
38+
39+
- name: Check diff file
40+
run: python -m nox -s is-diff-file-empty

.github/workflows/resync-piped.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Resync piped
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- master
11+
paths: ["piped", "piped.toml", "pyproject.toml"]
12+
13+
jobs:
14+
resync-piped:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
19+
with:
20+
submodules: "true"
21+
22+
- name: Set up Python 3.11
23+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
24+
with:
25+
python-version: "3.11"
26+
27+
- name: install prerequisites
28+
run: |
29+
python -m pip install --upgrade pip wheel
30+
python -m pip install -r ./piped/python/base-requirements/nox.txt
31+
32+
- name: Resync Piped
33+
run: python -m nox -s copy-piped bot-package-diff
34+
35+
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
36+
with:
37+
name: gogo.patch
38+
path: gogo.patch
39+
40+
- name: Check diff file
41+
run: python -m nox -s is-diff-file-empty

.github/workflows/type-check.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Type check
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
branches:
13+
- master
14+
schedule:
15+
- cron: "0 12 * * 6"
16+
workflow_dispatch:
17+
18+
jobs:
19+
type-check:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
24+
with:
25+
submodules: "true"
26+
27+
- name: Set up Python 3.11
28+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
29+
with:
30+
python-version: "3.11"
31+
32+
- name: install prerequisites
33+
run: |
34+
python -m pip install --upgrade pip wheel
35+
python -m pip install -r ./piped/python/base-requirements/nox.txt
36+
37+
- name: Run type checker
38+
run: python -m nox -s type-check

.github/workflows/upgrade-locks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@8eb1f6a495037164bea451156472f35fdd6bafc0
13+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
1414
with:
1515
submodules: "true"
1616

@@ -22,7 +22,7 @@ jobs:
2222
- name: install prerequisites
2323
run: |
2424
python -m pip install --upgrade pip wheel
25-
python -m pip install -r ./dev-requirements.txt
25+
python -m pip install -r ./piped/python/base-requirements/nox.txt
2626
2727
- name: Upgrade dependency locks
2828
run: python -m nox -s freeze-locks

.github/workflows/verify-locks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ on:
1111
pull_request:
1212
branches:
1313
- master
14-
paths: ["requirements.txt", "dev-requirements.txt"]
14+
paths: ["dev-requirements/*.txt"]
1515

1616
jobs:
1717
verify-pr-dep-changes:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/checkout@8eb1f6a495037164bea451156472f35fdd6bafc0
21+
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
2222
with:
2323
submodules: "true"
2424

@@ -30,7 +30,7 @@ jobs:
3030
- name: install prerequisites
3131
run: |
3232
python -m pip install --upgrade pip wheel
33-
python -m pip install -r ./dev-requirements.txt
33+
python -m pip install -r ./piped/python/base-requirements/nox.txt
3434
3535
- name: Verify dependency locks
36-
run: python -m nox -s verify-locks
36+
run: python -m nox -s verify-deps

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "piped"]
2+
path = piped
3+
url = https://github.com/FasterSpeeding/Piped.git

0 commit comments

Comments
 (0)