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

Fix pre-commit non-compliances #6161

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: no-commit-to-branch

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.10"
rev: "v0.6.8"
hooks:
- id: ruff
types: [file, python]
Expand All @@ -45,13 +45,13 @@ repos:
additional_dependencies: [tomli]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
types: [file, python]

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.18.0
hooks:
- id: blacken-docs
types: [file, rst]
Expand All @@ -63,15 +63,15 @@ repos:
types: [file, python]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.9.0'
rev: 'v1.11.2'
hooks:
- id: mypy
additional_dependencies:
- 'types-requests'
exclude: 'noxfile\.py|docs/src/conf\.py'

- repo: https://github.com/numpy/numpydoc
rev: v1.7.0
rev: v1.8.0
hooks:
- id: numpydoc-validation
exclude: "^lib/iris/tests/|docs/gallery_code/"
Expand Down
4 changes: 1 addition & 3 deletions lib/iris/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,7 @@ def assertRepr(self, obj, reference_filename):
def _check_same(self, item, reference_path, type_comparison_name="CML"):
if self._check_reference_file(reference_path):
with open(reference_path, "rb") as reference_fh:
reference = "".join(
part.decode("utf-8") for part in reference_fh.readlines()
)
reference = "".join(part.decode("utf-8") for part in reference_fh)
self._assert_str_same(reference, item, reference_path, type_comparison_name)
else:
self._ensure_folder(reference_path)
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/integration/test_netcdf__loadsaveattrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ def test_16_localstyle(self, local_attr, origin_style, do_split):
expected_result = [expect_global, expect_var]
if do_split and origin_style == "input_global":
# The result is simply the "other way around"
expected_result = expected_result[::-1]
expected_result.reverse()
self.check_roundtrip_results(expected_result)

@pytest.mark.parametrize("testcase", _MATRIX_TESTCASES[:max_param_attrs])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def run_testcase(self, warning_regex=None, **testcase_kwargs):
if self.debug_info:
print("\nCube:")
print(cube)
print("")
print()
return cube

def _make_testcase_cdl(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ def check_result(
self.assertEqual(1, len(cube.coords(dim_coords=True)))
(coord,) = coords
if self.debug_info:
print("")
print()
print("DEBUG : result coord =", coord)
print("")
print()

coord_stdname, coord_longname, coord_units, coord_crs = [
getattr(coord, name)
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ ignore = [

[tool.mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html
# TODO: remove when MyPy fixed (see https://github.com/python/mypy/issues/17166)
disable_error_code = ["call-arg"]
ESadek-MO marked this conversation as resolved.
Show resolved Hide resolved
enable_error_code = ["ignore-without-code", "truthy-bool"]
exclude = [
'noxfile\.py',
Expand Down Expand Up @@ -211,7 +213,7 @@ checks = [
"PR01", # Parameters ... not documented
"PR02", # Unknown parameters {....}
"PR04", # Parameter "...." has no type
"PR07", # Parameter "...." has no description
"PR07", # Parameter "...." has no description
"RT01", # No Returns section found
"RT03", # Return value has no description
]
Expand Down
Loading