Skip to content
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

Lint: Add check-peps.py #3275

Merged
merged 88 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8b71632
PEP 703, 720: Remove blank ``Resolution`` headers
AA-Turner Aug 5, 2023
6a01dda
PEP 499: Shorten title
AA-Turner Aug 5, 2023
3a6be91
Add ``pep-lint.py``
AA-Turner Aug 5, 2023
c6826fa
remove ``docs/`` from pep-lint
AA-Turner Aug 5, 2023
b4a8f13
Fix GHA syntax
AA-Turner Aug 5, 2023
ff95be9
datetime as dt
AA-Turner Aug 6, 2023
4ad0045
quotation marks
AA-Turner Aug 6, 2023
b0d6ba4
Use str builtins
AA-Turner Aug 6, 2023
8b32d59
Add initial tests for pep-lint
AA-Turner Aug 6, 2023
d2f80c7
Make tests stricter
AA-Turner Aug 6, 2023
018c726
typo
AA-Turner Aug 6, 2023
a088f99
Initial email tests
AA-Turner Aug 7, 2023
8fb81a6
Fully test _email
AA-Turner Aug 20, 2023
30ccbe7
Support passing a subset of PEPs via argv
AA-Turner Aug 20, 2023
fa8a54e
Support passing a subset of PEPs via argv
AA-Turner Aug 20, 2023
6116056
Add pep-lint hook to .pre-commit-config.yaml
AA-Turner Aug 20, 2023
84a08df
Parameterise header tests
AA-Turner Aug 20, 2023
3b20b56
Coverage
AA-Turner Aug 20, 2023
fc3e4ca
Merge remote-tracking branch 'upstream/main' into pep-lint
AA-Turner Aug 20, 2023
8919996
Test _pep_num
AA-Turner Aug 20, 2023
ab876b1
Test _thread
AA-Turner Aug 20, 2023
a3ae089
Test _date
AA-Turner Aug 20, 2023
bb3ed78
Test _validate_resolution
AA-Turner Aug 20, 2023
657e613
Test _validate_post_history
AA-Turner Aug 20, 2023
7b70ecc
Add pep-lint hook to .pre-commit-config.yaml
AA-Turner Aug 20, 2023
52a8d7d
Format
AA-Turner Aug 20, 2023
4b47d41
Test _validate_python_version
AA-Turner Aug 20, 2023
a821870
Test test_validate_created
AA-Turner Aug 20, 2023
1e17a1a
Test _validate_pep_references
AA-Turner Aug 20, 2023
8797cb0
Test _validate_content_type
AA-Turner Aug 20, 2023
d58ce26
Test _validate_topic
AA-Turner Aug 20, 2023
c1143a7
Format
AA-Turner Aug 20, 2023
e79f649
Add pep-lint hook to .pre-commit-config.yaml
AA-Turner Aug 20, 2023
33e9864
Support string filenames
AA-Turner Aug 20, 2023
ee0c1ca
Add pep-lint hook to .pre-commit-config.yaml
AA-Turner Aug 20, 2023
dffe4ea
Add pep-lint hook to .pre-commit-config.yaml
AA-Turner Aug 20, 2023
7ab98ad
Test _validate_type
AA-Turner Aug 20, 2023
e6a0dd9
Test _validate_status
AA-Turner Aug 20, 2023
a08aaf6
Test _validate_discussions_to
AA-Turner Aug 20, 2023
f008a92
Test _validate_delegate
AA-Turner Aug 20, 2023
24da438
Test _validate_sponsor
AA-Turner Aug 20, 2023
1e21a42
Test _validate_author
AA-Turner Aug 20, 2023
557c0f7
Test _validate_title
AA-Turner Aug 20, 2023
0e1ff27
Test _validate_pep_number
AA-Turner Aug 20, 2023
319a997
Test _validate_required_headers
AA-Turner Aug 20, 2023
89869d3
Format
AA-Turner Aug 20, 2023
ce9d603
Test check_direct_links
AA-Turner Aug 20, 2023
20a459d
Move to tests\pep_lint\
AA-Turner Aug 20, 2023
a834b5a
Format
AA-Turner Aug 20, 2023
12ba3ca
Move import machinery to conftest.py
AA-Turner Aug 20, 2023
b2ef99e
Split out test_headers
AA-Turner Aug 20, 2023
22e1a72
Split out test_direct_links
AA-Turner Aug 20, 2023
6454342
Split out test_pep_number
AA-Turner Aug 20, 2023
ba4b7d4
Split out test_email
AA-Turner Aug 20, 2023
f1e4683
Split out test_post_url
AA-Turner Aug 20, 2023
c7940b3
Split out test_date
AA-Turner Aug 20, 2023
8399fc9
Move remaining to test_headers
AA-Turner Aug 20, 2023
a3ad895
Add __init__.py
AA-Turner Aug 20, 2023
41964b6
Add integration test
AA-Turner Aug 20, 2023
b95a67f
Format
AA-Turner Aug 20, 2023
5f21f8c
Rework _output_error
AA-Turner Aug 20, 2023
9250d8e
lowercase
AA-Turner Aug 20, 2023
4b851c4
Format
AA-Turner Aug 20, 2023
67ab123
Split out _validate_header
AA-Turner Aug 20, 2023
efaff4e
Add types
AA-Turner Aug 20, 2023
fb8db10
str
AA-Turner Aug 20, 2023
f26c170
test
AA-Turner Aug 20, 2023
4e5eafb
Disable pre-commit hook
AA-Turner Aug 23, 2023
2456a48
Implement help & detailed
AA-Turner Aug 23, 2023
75eb099
Fix regression
AA-Turner Aug 23, 2023
29b770a
ENSURE REVERSION: Introduce errors
AA-Turner Aug 23, 2023
2d7274a
Quotation marks
AA-Turner Aug 23, 2023
5af19b0
Use detailed mode
AA-Turner Aug 23, 2023
ceed08d
Revert "ENSURE REVERSION: Introduce errors"
AA-Turner Aug 23, 2023
144370f
Rename pep-lint to check-pep
AA-Turner Aug 23, 2023
9366257
Pluralise
AA-Turner Aug 31, 2023
341e186
Run black
AA-Turner Aug 31, 2023
e9f99c0
Executability
AA-Turner Aug 31, 2023
2af8efa
Merge branch 'master' into pep-lint
AA-Turner Aug 31, 2023
b2d2de4
Merge branch 'master' into pep-lint
AA-Turner Aug 31, 2023
85ef844
Merge remote-tracking branch 'upstream/main' into pep-lint
AA-Turner Sep 1, 2023
efeaebb
Format pytest addopts as a nicer list
AA-Turner Sep 1, 2023
c71dba1
Merge branch 'master' into pep-lint
AA-Turner Sep 5, 2023
5db830c
pre-commit tweaks
AA-Turner Sep 5, 2023
017b0c8
match indentation
AA-Turner Sep 5, 2023
712d4b2
Extract default re flags out
AA-Turner Sep 5, 2023
11c5457
Not using types_or any more
AA-Turner Sep 5, 2023
f205724
Consolidate paths
AA-Turner Sep 5, 2023
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ contents.rst @AA-Turner
.codespell/ @CAM-Gerlach @hugovk
.codespellrc @CAM-Gerlach @hugovk
.pre-commit-config.yaml @CAM-Gerlach @hugovk
check-peps.py @AA-Turner @CAM-Gerlach @hugovk

# Git infrastructure
.gitattributes @CAM-Gerlach
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,17 @@ jobs:
uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files --hook-stage manual codespell || true

check-peps:
name: Run check-peps
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3"

- name: Run check-peps
run: python check-peps.py --detailed
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

minimum_pre_commit_version: '2.8.2'
minimum_pre_commit_version: '2.9.0'

default_language_version:
python: python3
Expand Down Expand Up @@ -101,6 +101,15 @@ repos:
# Local checks for PEP headers and more
- repo: local
hooks:
# # Hook to run 'check-peps.py'
# - id: "check-peps"
# name: "Check PEPs for metadata and content enforcement"
# entry: "python check-peps.py"
# language: "system"
# files: '^pep-\d{4}.(txt|rst)$'
# types_or: ["rst", "plain-text"]
# require_serial: true

- id: check-no-tabs
name: "Check tabs not used in PEPs"
language: pygrep
Expand Down
Loading