From e871e379b4f4a9e48658a51aa62dc36d3baf40b9 Mon Sep 17 00:00:00 2001 From: Leah Antkiewicz Date: Sun, 11 Aug 2024 21:50:38 -0400 Subject: [PATCH] Adding YAML formatter --- .github/workflows/changelog-entry-check.yml | 40 +++++----- .github/workflows/docs-issue.yml | 8 +- .github/workflows/release_prep_hatch.yml | 10 +-- .github/workflows/version-bump.yml | 4 +- .pre-commit-config.yaml | 86 +++++++++++---------- 5 files changed, 77 insertions(+), 71 deletions(-) diff --git a/.github/workflows/changelog-entry-check.yml b/.github/workflows/changelog-entry-check.yml index 889c0995..d0ddc521 100644 --- a/.github/workflows/changelog-entry-check.yml +++ b/.github/workflows/changelog-entry-check.yml @@ -1,29 +1,29 @@ name: Changelog entry check on: - pull_request: - types: - - opened - - reopened - - labeled - - unlabeled - - synchronize + pull_request: + types: + - opened + - reopened + - labeled + - unlabeled + - synchronize defaults: - run: - shell: bash + run: + shell: bash permissions: - contents: read - pull-requests: write + contents: read + pull-requests: write jobs: - changelog-entry-check: - uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main - with: - changelog_comment: >- - Thank you for your pull request! We could not find a changelog entry for this change. - For details on how to document a change, see the - [dbt-postgres contributing guide](https://github.com/dbt-labs/dbt-postgres/blob/main/CONTRIBUTING.md). - skip_label: "Skip Changelog" - secrets: inherit + changelog-entry-check: + uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main + with: + changelog_comment: >- + Thank you for your pull request! We could not find a changelog entry for this change. + For details on how to document a change, see the + [dbt-postgres contributing guide](https://github.com/dbt-labs/dbt-postgres/blob/main/CONTRIBUTING.md). + skip_label: "Skip Changelog" + secrets: inherit diff --git a/.github/workflows/docs-issue.yml b/.github/workflows/docs-issue.yml index f49cf517..b9e40930 100644 --- a/.github/workflows/docs-issue.yml +++ b/.github/workflows/docs-issue.yml @@ -20,7 +20,7 @@ defaults: shell: bash permissions: - issues: write # comments on issues + issues: write # comments on issues jobs: open_issues: @@ -35,7 +35,7 @@ jobs: (github.event.action == 'labeled' && github.event.label.name == 'user docs')) uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main with: - issue_repository: "dbt-labs/docs.getdbt.com" - issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" - issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." + issue_repository: "dbt-labs/docs.getdbt.com" + issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" + issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." secrets: inherit diff --git a/.github/workflows/release_prep_hatch.yml b/.github/workflows/release_prep_hatch.yml index 18d7637b..61e1443a 100644 --- a/.github/workflows/release_prep_hatch.yml +++ b/.github/workflows/release_prep_hatch.yml @@ -165,8 +165,8 @@ jobs: runs-on: ubuntu-latest needs: release-inputs if: | - needs.release-inputs.outputs.changelog-exists == 'false' || - needs.release-inputs.outputs.version-is-current == 'false' + needs.release-inputs.outputs.changelog-exists == 'false' || + needs.release-inputs.outputs.version-is-current == 'false' outputs: name: ${{ steps.release-branch.outputs.name }} @@ -404,9 +404,9 @@ jobs: - release-branch - release-inputs if: | - !failure() && !cancelled() && - needs.release-branch.result == 'success' && - inputs.deploy-to == 'prod' + !failure() && !cancelled() && + needs.release-branch.result == 'success' && + inputs.deploy-to == 'prod' steps: - name: "Checkout ${{ github.event.repository.name }}" diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index bde34d68..a74d8971 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -17,8 +17,8 @@ on: workflow_dispatch: inputs: version_number: - description: 'The version number to bump to (ex. 1.2.0, 1.3.0b1)' - required: true + description: 'The version number to bump to (ex. 1.2.0, 1.3.0b1)' + required: true jobs: version_bump_and_changie: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0bd01f7c..13ee2f65 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,51 +6,57 @@ repos: rev: v4.4.0 hooks: - id: check-yaml - args: [--unsafe] - id: check-json - id: end-of-file-fixer - id: trailing-whitespace - id: check-case-conflict -- repo: https://github.com/dbt-labs/pre-commit-hooks - rev: v0.1.0a1 - hooks: - - id: dbt-core-in-adapters-check +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.14.0 + hooks: + - id: pretty-format-yaml + args: [--autofix, --indent, '2', --offset, '2', --preserve-quotes] + files: ^.github/workflows + +- repo: https://github.com/dbt-labs/pre-commit-hooks + rev: v0.1.0a1 + hooks: + - id: dbt-core-in-adapters-check -- repo: https://github.com/psf/black - rev: 24.4.0 - hooks: - - id: black - args: - - --line-length=99 - - --target-version=py38 - - --target-version=py39 - - --target-version=py310 - - --target-version=py311 - - --target-version=py312 +- repo: https://github.com/psf/black + rev: 24.4.0 + hooks: + - id: black + args: + - --line-length=99 + - --target-version=py38 + - --target-version=py39 + - --target-version=py310 + - --target-version=py311 + - --target-version=py312 -- repo: https://github.com/pycqa/flake8 - rev: 7.0.0 - hooks: - - id: flake8 - exclude: tests/ - args: - - --max-line-length=99 - - --select=E,F,W - - --ignore=E203,E501,E741,W503,W504 - - --per-file-ignores=*/__init__.py:F401 +- repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + exclude: tests/ + args: + - --max-line-length=99 + - --select=E,F,W + - --ignore=E203,E501,E741,W503,W504 + - --per-file-ignores=*/__init__.py:F401 -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 - hooks: - - id: mypy - args: - - --explicit-package-bases - - --ignore-missing-imports - - --pretty - - --show-error-codes - files: ^dbt/adapters/postgres - additional_dependencies: - - types-PyYAML - - types-protobuf - - types-pytz +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.9.0 + hooks: + - id: mypy + args: + - --explicit-package-bases + - --ignore-missing-imports + - --pretty + - --show-error-codes + files: ^dbt/adapters/postgres + additional_dependencies: + - types-PyYAML + - types-protobuf + - types-pytz