Skip to content

Commit

Permalink
Aggiunte automazioni per la stesura del codice (#115)
Browse files Browse the repository at this point in the history
Aggiunto prettier e conventional commit per formattazione e stesura dei messaggi di commit
  • Loading branch information
guizzo authored Sep 27, 2023
1 parent b4977cf commit a520ed9
Show file tree
Hide file tree
Showing 8 changed files with 2,386 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ['@commitlint/config-conventional']
}
5 changes: 4 additions & 1 deletion .github/workflows/formatting-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Prettier Check
run: npx prettier --check "**/*.md"
run: npm run format:check
1 change: 1 addition & 0 deletions .lefthook/commit-msg/commitlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo $(head -n1 $1) | npx commitlint --color
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.18.0
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Tutti i file markdown devono essere formattati con [Prettier](https://prettier.i
Per formattare da linea di comando tutti i file è necessario avere [Node](https://nodejs.org/it) installato sul proprio computer e lanciare il seguente comando nella cartella del repository:

```bash
npm run format
npm run format:write -- *.md
```

Fortunatamente i principali IDE supportano Prettier tramite delle estensioni, di seguito alcuni esempi:
Expand Down
16 changes: 16 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
colors: true
pre-commit:
commands:
prettier:
glob: "*.md"
run: npm run format:write {staged_files}
commit-msg:
scripts:
"commitlint.sh":
runner: bash
pre-push:
commands:
format-check:
glob: "*.md"
run: npm run format:check

Loading

0 comments on commit a520ed9

Please sign in to comment.