Skip to content

Commit

Permalink
CI: Use ruff for copyright header checking
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplershift committed Jan 11, 2024
1 parent be93045 commit d7f7c10
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion ci/linting_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pycodestyle==2.11.1
pyflakes==3.2.0

flake8-continuation==1.0.5
flake8-copyright==0.2.4
flake8-isort==6.1.1
isort==5.13.2
flake8-requirements==2.0.1
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ filterwarnings = [
[tool.ruff]
line-length = 95
exclude = ["docs", "build", "src/metpy/io/_metar_parser/metar_parser.py"]
select = ["A", "B", "C", "D", "E", "E226", "F", "G", "I", "N", "Q", "R", "S", "T", "U", "W"]
select = ["A", "B", "C", "CPY001", "D", "E", "E226", "F", "G", "I", "N", "Q", "R", "S", "T", "U", "W"]
ignore = ["F405", "I001", "RET504", "RET505", "RET506", "RET507", "RUF100"]
preview = true
explicit-preview-rules = true
Expand All @@ -129,7 +129,7 @@ explicit-preview-rules = true
"docs/doc-server.py" = ["T201"]
"examples/*.py" = ["D", "T201", "B018"]
"src/metpy/_vendor/xarray.py" = ["UP032"]
"src/metpy/deprecation.py" = ["UP032"]
"src/metpy/deprecation.py" = ["CPY001", "UP032"]
"src/metpy/testing.py" = ["S101"]
"src/metpy/io/nexrad.py" = ["S101"]
"tests/*/*.py" = ["S101"]
Expand All @@ -139,6 +139,11 @@ explicit-preview-rules = true
"tools/nexrad_msgs/parse_spec.py" = ["B028", "S101"]
"tutorials/*.py" = ["D", "T201", "B018"]

[tool.ruff.lint.flake8-copyright]
# Needed to add a comma
notice-rgx = "(?i)Copyright\\s+(\\(C\\)\\s+)?\\d{4}([-,]\\d{4})*"
author = "MetPy Developers"

[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "double"
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ rst-roles = class, data, doc, func, meth, mod
rst-directives = plot, versionchanged
known-modules = matplotlib:[matplotlib,mpl_toolkits],netcdf4:[netCDF4]
exclude = docs build src/metpy/io/_metar_parser/metar_parser.py
select = C E301 E302 E303 E304 E305 E306 I R
select = E301 E302 E303 E304 E305 E306 I R
ignore = F405 W503 RST902 SIM106
per-file-ignores = examples/*.py: D MPY001
tutorials/*.py: D MPY001
src/metpy/deprecation.py: C801
src/metpy/calc/*.py: RST306
src/metpy/interpolate/*.py: RST306
src/metpy/io/*.py: RST306
Expand Down

0 comments on commit d7f7c10

Please sign in to comment.