From d1ac15a4ef8c536940a74390b409c6c10b6c55c9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 17 Mar 2025 11:41:15 +0100 Subject: [PATCH 1/2] cpplint_clitest.py: Function names should be lowercase --- cpplint_clitest.py | 10 +++++----- pyproject.toml | 14 +++++++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cpplint_clitest.py b/cpplint_clitest.py index 4185000..acfa662 100755 --- a/cpplint_clitest.py +++ b/cpplint_clitest.py @@ -76,7 +76,7 @@ def run_shell_command(cmd: str, args: str, cwd="."): class TestUsage: - def testHelp(self): + def test_help(self): (status, out, err) = run_shell_command(BASE_CMD, "--help") assert status == 0 assert out == b"" @@ -186,7 +186,7 @@ def get_extra_command_args(self, cwd): name_func=lambda fun, _, x: f"test{x.args[0].capitalize()}Sample-{x.args[1]}", ) @pytest.mark.timeout(180) - def testSamples(self, folder, case): + def test_samples(self, folder, case): self.check_def(os.path.join(f"./samples/{folder}-sample", case + ".def")) @@ -198,7 +198,7 @@ def prepare_directory(cls, root): with open(os.path.join(root, ".git"), "a"): pass - def testCodeliteSample(self): + def test_codelite_sample(self): self.check_all_in_folder("./samples/codelite-sample", 1) @@ -210,7 +210,7 @@ def prepare_directory(cls, root): with open(os.path.join(root, ".hg"), "a"): pass - def testCodeliteSample(self): + def test_codelite_sample(self): self.check_all_in_folder("./samples/codelite-sample", 1) @@ -222,7 +222,7 @@ def prepare_directory(cls, root): with open(os.path.join(root, ".svn"), "a"): pass - def testCodeliteSample(self): + def test_codelite_sample(self): self.check_all_in_folder("./samples/codelite-sample", 1) diff --git a/pyproject.toml b/pyproject.toml index cb381d6..9316c89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,11 +127,19 @@ lint.ignore = [ "FBT003", # flake8-boolean-trap "FIX002", # flake8-fixme "ISC003", # flake8-implicit-str-concat - "N802", # invalid-function-name "PIE790", # Unnecessary `pass` statement ] -lint.per-file-ignores."cpplint.py" = [ "ICN001", "PERF401", "PLR5501", "PLW0603", "PLW2901", "SIM102", "SIM108" ] -lint.per-file-ignores."cpplint_unittest.py" = [ "FLY002", "PLW0604", "SIM115", "UP031" ] +lint.per-file-ignores."cpplint.py" = [ + "ICN001", + "N802", + "PERF401", + "PLR5501", + "PLW0603", + "PLW2901", + "SIM102", + "SIM108", +] +lint.per-file-ignores."cpplint_unittest.py" = [ "FLY002", "N802", "PLW0604", "SIM115", "UP031" ] lint.mccabe.max-complexity = 29 lint.pylint.allow-magic-value-types = [ "bytes", "int", "str" ] lint.pylint.max-args = 10 # Default is 5 From 8ce28c5180011537fafd4585870339078338110c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 18 Mar 2025 09:58:42 +0100 Subject: [PATCH 2/2] name_func=lambda fun, _, x: f"test_{x.args[0]}_sample-{x.args[1]}" Co-authored-by: Aaron Liu --- cpplint_clitest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpplint_clitest.py b/cpplint_clitest.py index acfa662..91c69cc 100755 --- a/cpplint_clitest.py +++ b/cpplint_clitest.py @@ -183,7 +183,7 @@ def get_extra_command_args(self, cwd): for case in os.listdir(f"./samples/{folder}-sample") if case.endswith(".def") ], - name_func=lambda fun, _, x: f"test{x.args[0].capitalize()}Sample-{x.args[1]}", + name_func=lambda fun, _, x: f"test_{x.args[0]}_sample-{x.args[1]}", ) @pytest.mark.timeout(180) def test_samples(self, folder, case):