From 23c47fb80236bd4b8cd549270afd0b8491878ae1 Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Mon, 26 Feb 2024 16:04:24 +0000 Subject: [PATCH] review actions --- cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py | 3 +-- cf_units/tests/integration/parse/test_parse.py | 4 ++-- pyproject.toml | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py b/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py index 6bac1ac0..428d5978 100644 --- a/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py +++ b/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py @@ -6,8 +6,7 @@ else: from udunits2Parser import udunits2Parser -# This class defines a complete generic visitor for a parse tree produced by -# udunits2Parser. +# This class defines a complete generic visitor for a parse tree produced by udunits2Parser. class udunits2ParserVisitor(ParseTreeVisitor): diff --git a/cf_units/tests/integration/parse/test_parse.py b/cf_units/tests/integration/parse/test_parse.py index bc0498f5..5a86371c 100644 --- a/cf_units/tests/integration/parse/test_parse.py +++ b/cf_units/tests/integration/parse/test_parse.py @@ -242,7 +242,7 @@ def test_known_issues(_, unit_str, expected): # These are the cases that don't work yet but which do work with udunits. # Make sure udunits can read it. - cf_units.Unit(unit_str).symbol # noqa: B018 + _ = cf_units.Unit(unit_str).symbol if isinstance(expected, type) and issubclass(expected, Exception): with pytest.raises(SyntaxError): @@ -293,7 +293,7 @@ def test_invalid_syntax_units(_, unit_str): # allowed with our grammar. with pytest.raises(ValueError): - cf_units.Unit(unit_str).symbol # noqa: B018 + _ = cf_units.Unit(unit_str).symbol with pytest.raises(SyntaxError): normalize(unit_str) diff --git a/pyproject.toml b/pyproject.toml index 880fe99a..67d0778d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,3 +73,7 @@ max-complexity = 22 [tool.ruff.pydocstyle] convention = "numpy" + +[tool.ruff.per-file-ignores] +# Allow the longer comment lines that the generated code produces. +"cf_units/_udunits2_parser/parser/*.py" = ["E501"]