Skip to content

Commit

Permalink
Merge pull request #200 from kachick/drop-dprint-process-plugins
Browse files Browse the repository at this point in the history
Replace dprint prettier plugin with yamlfmt
  • Loading branch information
kachick authored May 16, 2024
2 parents bc36a68 + cddcd0a commit 9990ad3
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 10 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 .
3 changes: 1 addition & 2 deletions .github/workflows/merge-bot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Judge
id: conclusion
if: >-
steps.dependabot.outputs.update-type != 'version-update:semver-major' ||
contains(steps.dependabot.outputs.dependency-names, 'DeterminateSystems')
steps.dependabot.outputs.update-type != 'version-update:semver-major' || contains(steps.dependabot.outputs.dependency-names, 'DeterminateSystems')
run: echo -n 'merge=true' | tee -a "$GITHUB_OUTPUT"
dependabot:
needs: [judge-dependabot]
Expand Down
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
7 changes: 6 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,27 @@ tasks:
cmds:
- typos . .github .vscode --write-changes
- dprint fmt
- yamlfmt .
- go fmt ./...
- nix fmt ./**/*.nix
- git ls-files '*.nix' | xargs nix fmt
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
# nix fmt doesn't have check: https://github.com/NixOS/nix/issues/6918
- git ls-files '*.nix' | xargs nixfmt --check
deps:
cmds:
- nix --version
- nixfmt --version
- 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 9990ad3

Please sign in to comment.