Skip to content

Commit

Permalink
Merge pull request #1074 from ocefpaf/fix_lint
Browse files Browse the repository at this point in the history
Fix lint
  • Loading branch information
ocefpaf authored May 22, 2024
2 parents 70d4761 + 12f6a41 commit f4e27e5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:
- id: ruff

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.0.4
rev: 2.1.3
hooks:
- id: pyproject-fmt

Expand Down
4 changes: 2 additions & 2 deletions compliance_checker/cf/cf_1_8.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ def check_groups(self, ds: Dataset):
for attr in ginstance.ncattrs():
if attr in CF1_8Check.ROOT_GROUP_ONLY_ATTRS:
ctx_hi.messages.append(
f'§2.7.2 Attribute "{ attr }" MAY ONLY be used in the root group '
f'§2.7.2 Attribute "{attr}" MAY ONLY be used in the root group '
"and SHALL NOT be duplicated or overridden in child groups.",
)

results.append(ctx_hi.to_result())

elif attr in CF1_8Check.NON_ROOT_GROUP_OPT:
ctx_lo.messages.append(
f"§2.7.2 Note: attribute '{ attr }' found on non-root group '{ gname }'. "
f'§2.7.2 Note: attribute "{attr}" found on non-root group "{gname}". '
"This is optional for non-root groups. It is allowed in order to provide additional "
"provenance and description of the subsidiary data. It does not override "
"attributes from parent groups.",
Expand Down
33 changes: 16 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,38 +87,37 @@ write_to_template = "__version__ = '{version}'"
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"

[tool.ruff]
target-version = "py38"
line-length = 200

exclude = [
"compliance_checker/cf/cf.py",
]

lint.select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodecstyle
"F", # flakes
"I", # import sorting
"W", # pydocstyle
"UP", # upgrade
"W", # pydocstyle
]
target-version = "py38"
line-length = 200

exclude = [
"compliance_checker/cf/cf.py",
]

lint.ignore = [
"E501",
]

[tool.ruff.lint.per-file-ignores]
"docs/source/conf.py" = [
"E402",
"A001",
]
"compliance_checker/cfutil.py" = [
"B028",
]
"compliance_checker/cf/appendix_f.py" = [
lint.per-file-ignores."compliance_checker/cf/appendix_f.py" = [
"B033",
] # ignore duplicates items in the set
lint.per-file-ignores."compliance_checker/cfutil.py" = [
"B028",
]
lint.per-file-ignores."docs/source/conf.py" = [
"A001",
"E402",
]

[tool.pytest.ini_options]
markers = [
Expand Down

0 comments on commit f4e27e5

Please sign in to comment.