From d8e9b2ee314752cc7bfa1b6cb6a0ff4450be2c1f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:03:40 +0100 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.3.0) - [github.com/asottile/pyupgrade: v3.15.1 → v3.15.2](https://github.com/asottile/pyupgrade/compare/v3.15.1...v3.15.2) - [github.com/psf/black: 24.3.0 → 24.4.2](https://github.com/psf/black/compare/24.3.0...24.4.2) - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0) * Update test_initial.py - linting line 878 Signed-off-by: Jim-smith * Update acro_stata_parser.py linting for line 267 Signed-off-by: Jim-smith * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Jim-smith Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jim-smith --- .pre-commit-config.yaml | 10 +++++----- acro/acro_stata_parser.py | 1 + test/test_initial.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b23e189..3538cc0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer @@ -26,7 +26,7 @@ repos: # Check for spelling - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell args: ["-L", "tre"] @@ -39,7 +39,7 @@ repos: # Upgrade old Python syntax - repo: https://github.com/asottile/pyupgrade - rev: v3.15.1 + rev: v3.15.2 hooks: - id: pyupgrade args: [--py310-plus] @@ -66,7 +66,7 @@ repos: # Black format Python and notebooks - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black-jupyter @@ -84,7 +84,7 @@ repos: # Check types with mypy - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.0 hooks: - id: mypy args: ["--ignore-missing-imports", "--follow-imports", "skip", "--check-untyped-defs"] diff --git a/acro/acro_stata_parser.py b/acro/acro_stata_parser.py index aa9f38a..b9e5cbc 100644 --- a/acro/acro_stata_parser.py +++ b/acro/acro_stata_parser.py @@ -288,6 +288,7 @@ def run_output_command(command: str, varlist: list) -> str: first element of varlist is output affected rest (if relevant) is string passed to command. """ + outcome = "" if len(varlist) == 0: return "syntax error: please pass the name of the output to be changed" diff --git a/test/test_initial.py b/test/test_initial.py index f285ff6..058d378 100644 --- a/test/test_initial.py +++ b/test/test_initial.py @@ -875,7 +875,7 @@ def test_crosstab_multiple_aggregate_function(data, acro): assert ( output.summary == correct_summary ), f"\n{output.summary}\n should be \n{correct_summary}\n" - print(f"{output.output[0]['mean'][ 'R/G'].sum()}") + print(f"{output.output[0]['mean']['R/G'].sum()}") correctval = 97383496.0 errmsg = f"{output.output[0]['mean']['R/G'].sum()} should be {correctval}" assert correctval == output.output[0]["mean"]["R/G"].sum(), errmsg