From 0cb203030a481ca91a3888df019f6a4a2bd19021 Mon Sep 17 00:00:00 2001 From: Felix Leupold Date: Mon, 19 Aug 2024 19:03:05 +0200 Subject: [PATCH 1/2] Configure linter --- .github/workflows/pull-request.yaml | 17 +++++++++++++++++ .sqlfluff | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/pull-request.yaml create mode 100644 .sqlfluff diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 00000000..29495859 --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,17 @@ +name: Lint + +on: [push, pull_request] + +jobs: + sqlfluff: + name: SQLFluff + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: Install SQLFluff + run: pip install sqlfluff + - name: Run SQLFluff + run: sqlfluff lint . diff --git a/.sqlfluff b/.sqlfluff new file mode 100644 index 00000000..a72d5d80 --- /dev/null +++ b/.sqlfluff @@ -0,0 +1,4 @@ +[sqlfluff] +dialect = ansi +exclude_rules = L046, RF02, RF06 +max_line_length = 120 From 1e9c97b4c6ce78475cfb9e511986b2d2694048d0 Mon Sep 17 00:00:00 2001 From: Felix Leupold Date: Mon, 19 Aug 2024 19:05:05 +0200 Subject: [PATCH 2/2] dont double run --- .github/workflows/pull-request.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 29495859..10cf85d3 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,7 +1,8 @@ name: Lint - -on: [push, pull_request] - +on: + pull_request: + push: + branches: [main] jobs: sqlfluff: name: SQLFluff