Skip to content

Commit

Permalink
try adding prettier and editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Jan 4, 2024
1 parent fd7276f commit b91db90
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
indent_style = space

[*.{md,yml,yaml,cff}]
indent_size = 2
38 changes: 38 additions & 0 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ concurrency:
cancel-in-progress: true

jobs:

# Use ruff to check for code style violations
ruff-check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -98,3 +99,40 @@ jobs:
echo "Requirements are different"
exit 1
fi
# Use Prettier to check various file formats
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install Prettier
run: npm install -g prettier

- name: Run Prettier --check
run: prettier --check .

# Use editorconfig to check all remaining file formats
editorconfig:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker

- name: editorconfig --> Lint files
run: editorconfig-checker $(git ls-files | grep -v 'test\|.py\|.md\|.json\|.yml\|.yaml\|.html')


0 comments on commit b91db90

Please sign in to comment.