Skip to content

Commit

Permalink
Replace dprint prettier plugin with yamlfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed May 16, 2024
1 parent bc36a68 commit a6cfb5e
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ jobs:
.
.github
.vscode
yamlfmt:
timeout-minutes: 15
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Install yamlfmt
run: go install github.com/google/yamlfmt/cmd/[email protected] # TODO: Apply selfup after https://github.com/google/yamlfmt/pull/180
- run: yamlfmt -lint .
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"editorconfig.editorconfig",
"tekumara.typos-vscode",
"dprint.dprint",
"kachick.vscode-yamlfmt",
"jnoortheen.nix-ide",
"task.vscode-task"
]
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true,
"[yaml]": {
"editor.defaultFormatter": "kachick.vscode-yamlfmt"
},
"[github-actions-workflow]": {
"editor.defaultFormatter": "kachick.vscode-yamlfmt"
},
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
},
Expand Down
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ tasks:
cmds:
- typos . .github .vscode --write-changes
- dprint fmt
- yamlfmt .
- go fmt ./...
- nix fmt ./**/*.nix
lint:
# go fmt does not have option for no effect - https://github.com/golang/go/issues/41189
# nix fmt does not have option for no effect - https://github.com/NixOS/nix/issues/6918
cmds:
- dprint check
- yamlfmt -lint .
- go vet ./...
- goreleaser check
- typos . .github .vscode
Expand All @@ -53,5 +55,6 @@ tasks:
- task --version
- go version
- dprint --version
- yamlfmt -version
- goreleaser --version
- typos --version
9 changes: 2 additions & 7 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"json": {},
"markdown": {},
"prettier": {
"printWidth": 120,
"singleQuote": true
},
"excludes": ["dist", ".goreleaser.yaml"],
"excludes": ["dist"],
"plugins": [
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.16.4.wasm",
"https://plugins.dprint.dev/prettier-0.40.0.json@68c668863ec834d4be0f6f5ccaab415df75336a992aceb7eeeb14fdf096a9e9c"
"https://plugins.dprint.dev/markdown-0.16.4.wasm"
]
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

edge-pkgs.go_1_22
edge-pkgs.dprint
edge-pkgs.yamlfmt
edge-pkgs.goreleaser
edge-pkgs.typos
go-task
Expand Down
7 changes: 7 additions & 0 deletions yamlfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gitignore_excludes: true
exclude:
- '.goreleaser.yaml'
line_ending: lf
formatter:
type: basic
retain_line_breaks_single: true

0 comments on commit a6cfb5e

Please sign in to comment.