From ec032f9461934c9ff42271b7b6f6431851948f3c Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 28 Aug 2022 19:45:55 +0200 Subject: [PATCH] chore: Add `prettier`. --- .editorconfig | 10 ++++++++-- .github/workflows/prettier.yml | 22 ++++++++++++++++++++++ .prettierignore | 6 ++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/prettier.yml create mode 100644 .prettierignore diff --git a/.editorconfig b/.editorconfig index 654c18b..9f14c50 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,6 +13,12 @@ insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 4 +max_line_length = 120 -[*.{json,json.dist,yml,yml.dist}] -indent_size = 4 \ No newline at end of file +[*.{json,json.dist,yml,yaml,yml.dist,yaml.dist}] +indent_size = 4 +max_line_length = 120 + +[*.{md}] +indent_size = 2 +max_line_length = 80 \ No newline at end of file diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..9ea299a --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,22 @@ +name: Prettier checks + +# This action works with pull requests and pushes +on: + pull_request: + push: + branches: + - master + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install the Nix package manager + uses: cachix/install-nix-action@v17 + + - name: Checks + run: nix run nixpkgs#nodePackages.prettier -- --check . diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6e87e98 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +/.direnv/ +/.idea/ +/build/ +/vendor/ +/docs/ +CHANGELOG.md \ No newline at end of file