From 0cbbf70d85074d6eb56e1bf589d8fad5f7b7dac1 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 24 Jan 2024 13:44:09 -0600 Subject: [PATCH] split up pre-commit linting --- .pre-commit-config.yaml | 20 +++++++++++++++++--- dbt_common/clients/jinja.py | 8 ++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3a346b18..746db253 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,9 +20,23 @@ repos: - id: check-case-conflict - repo: local hooks: - - id: linter - name: linter - entry: hatch run lint:all + - id: black + name: black + entry: hatch run lint:black + language: system + types: [python] + pass_filenames: false + verbose: true + - id: flake8 + name: flake8 + entry: hatch run lint:flake8 + language: system + types: [python] + pass_filenames: false + verbose: true + - id: mypy + name: mypy + entry: hatch run lint:mypy language: system types: [python] pass_filenames: false diff --git a/dbt_common/clients/jinja.py b/dbt_common/clients/jinja.py index 897300aa..5b532b9f 100644 --- a/dbt_common/clients/jinja.py +++ b/dbt_common/clients/jinja.py @@ -114,7 +114,9 @@ def new_context( # This custom override makes the assumption that the locals and shared # parameters are not used, so enforce that. if shared or locals: - raise Exception("The MacroFuzzTemplate.new_context() override cannot use the shared or locals parameters.") + raise Exception( + "The MacroFuzzTemplate.new_context() override cannot use the shared or locals parameters." + ) parent = ChainMap(vars, self.globals) if self.globals else vars @@ -122,7 +124,9 @@ def new_context( def render(self, *args: Any, **kwargs: Any) -> Any: if kwargs or len(args) != 1: - raise Exception("The MacroFuzzTemplate.render() override requires exactly one argument.") + raise Exception( + "The MacroFuzzTemplate.render() override requires exactly one argument." + ) ctx = self.new_context(args[0])