From d6e0f145cf8d16bef4302d7ae4196e9b028fd411 Mon Sep 17 00:00:00 2001 From: Natik Gadzhi Date: Sun, 15 Dec 2024 22:04:38 -0800 Subject: [PATCH] pre-commit for python + java --- .pre-commit-config.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9a14efde8a2..2d89105f08ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,12 +5,10 @@ exclude: | ^.*?/\.venv/.*$| ^.*?/node_modules/.*$| - # Specific directories ^.*?/charts/.*$| ^airbyte-integrations/bases/base-normalization/.*$| ^.*?/normalization_test_output/.*$| - # Specific files ^.*?/pnpm-lock\.yaml$| ^.*?/source-amplitude/unit_tests/api_data/zipped\.json$| @@ -54,9 +52,9 @@ repos: additional_dependencies: [github.com/google/addlicense@v1.1.1] files: \.(java|kt|py)$ - # - id: spotless - # name: Format Java files with Spotless - # entry: mvn -f spotless-maven-pom.xml spotless:apply - # language: system - # files: \.(java|kt|gradle)$ - # pass_filenames: false + - id: spotless + name: Format Java files with Spotless + entry: bash -c 'command -v mvn >/dev/null 2>&1 || { echo "Maven not installed, skipping spotless" >&2; exit 0; }; mvn -f spotless-maven-pom.xml spotless:apply' + language: system + files: \.(java|kt|gradle)$ + pass_filenames: false