From 67decf66b9f33ef68c0187474438bd51f4f9f8be Mon Sep 17 00:00:00 2001 From: Kirill Druzhinin Date: Tue, 27 Feb 2024 16:52:11 +0100 Subject: [PATCH] Include prettier linter --- .github/workflows/ci.yml | 8 ++++---- .pre-commit-config.yaml | 26 ++++++++++++++++---------- README.md | 26 +++++++++++++++----------- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7866a9..91d2e6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,27 +5,27 @@ on: branches: - master paths-ignore: - - 'docs/**' + - "docs/**" push: branches: - master paths-ignore: - - 'docs/**' + - "docs/**" jobs: build: runs-on: ubuntu-latest strategy: matrix: - python: [ "3.10", "3.11" ] + python: ["3.10", "3.11"] steps: - uses: actions/checkout@v4 - name: Set up PDM uses: pdm-project/setup-pdm@v3 with: - python-version: '3.10' + python-version: "3.10" - name: Install dependencies run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6667bd1..4287718 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,26 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: check-added-large-files - - id: check-toml - - id: end-of-file-fixer - - id: trailing-whitespace -- repo: https://github.com/charliermarsh/ruff-pre-commit + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-added-large-files + - id: check-toml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.2.2 hooks: - id: ruff - args: [ --fix ] + args: [--fix] description: Run linter with fixes enabled - id: ruff-format description: Run formatter -- repo: local + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + description: Run prettier + types_or: [yaml, toml, json, markdown] + - repo: local hooks: - id: tox_lint name: lint diff --git a/README.md b/README.md index 2804f15..d3c92a4 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ Linter for dbt model metadata. You'll need the following prerequisites: -* Any Python version starting from 3.10 -* [pre-commit](https://pre-commit.com/) -* [PDM](https://pdm-project.org/2.12/) +- Any Python version starting from 3.10 +- [pre-commit](https://pre-commit.com/) +- [PDM](https://pdm-project.org/2.12/) Configure development environment running these commands from the project's root: @@ -25,9 +25,11 @@ purposes. ### Lint `dbt_score` uses: -* [ruff](https://docs.astral.sh/ruff/) for fast linting and formatting. -* [mypy](https://mypy.readthedocs.io/en/stable/) for type checking. -* [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks). + +- [ruff](https://docs.astral.sh/ruff/) for fast linting and formatting. +- [mypy](https://mypy.readthedocs.io/en/stable/) for type checking. +- [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks). +- [prettier-hooks](https://github.com/pre-commit/mirrors-prettier). Cheatsheet: @@ -41,9 +43,10 @@ pdm run tox -e lint ### Test `dbt_score` uses: -* [pytest](https://docs.pytest.org/) as a main test framework. -* [coverage](https://coverage.readthedocs.io/en/latest/index.html) for test coverage. -* [tox](https://tox.wiki/en/latest/) for testing against multiple Python versions. + +- [pytest](https://docs.pytest.org/) as a main test framework. +- [coverage](https://coverage.readthedocs.io/en/latest/index.html) for test coverage. +- [tox](https://tox.wiki/en/latest/) for testing against multiple Python versions. Cheatsheet: @@ -56,8 +59,9 @@ pdm run coverage run -m pytest ### Docs `dbt_score` uses: -* [mkdocs](https://www.mkdocs.org/) for docs generation. -* [mkdocstrings](https://mkdocstrings.github.io/) for automatic docs from sources. + +- [mkdocs](https://www.mkdocs.org/) for docs generation. +- [mkdocstrings](https://mkdocstrings.github.io/) for automatic docs from sources. Cheatsheet: