Skip to content

Commit

Permalink
fix remaning lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed May 22, 2024
1 parent 0fefa73 commit 12f6a41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
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 12f6a41

Please sign in to comment.