Skip to content

Commit

Permalink
Merge pull request #208 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 20, 2024
2 parents 95dc081 + b055569 commit 53407a1
Show file tree
Hide file tree
Showing 7 changed files with 30 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 @@ -16,6 +16,17 @@ jobs:
with:
dprint-version: '0.45.1' # selfup { "regex": "\\d[^']+", "script": "dprint --version | cut -d ' ' -f 2" }

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 .

typos:
timeout-minutes: 15
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"github.vscode-github-actions",
"rubocop.vscode-rubocop",
"tekumara.typos-vscode",
"dprint.dprint"
"dprint.dprint",
"kachick.vscode-yamlfmt"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"[ruby]": {
"editor.defaultFormatter": "rubocop.vscode-rubocop"
},
"[yaml]": {
"editor.defaultFormatter": "kachick.vscode-yamlfmt"
},
"[github-actions-workflow]": {
"editor.defaultFormatter": "kachick.vscode-yamlfmt"
},
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
},
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ desc 'Print dependencies'
task :deps do
sh('ruby --version')
sh('dprint --version')
sh('yamlfmt -version')
sh('tree --version')
sh('typos --version')
sh('nix --version')
Expand All @@ -48,6 +49,7 @@ end
desc 'Linters except ruby'
task :linters do
sh('dprint check')
sh('yamlfmt -lint .')
sh('typos . .github .vscode')
sh(%q!git ls-files '*.nix' | xargs nixfmt --check!)
end
7 changes: 1 addition & 6 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
},
"markdown": {
},
"prettier": {
"printWidth": 120,
"singleQuote": true
},
"excludes": [
".git",
"**/*lock.json",
Expand All @@ -15,7 +11,6 @@
],
"plugins": [
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.17.0.wasm",
"https://plugins.dprint.dev/prettier-0.40.0.json@68c668863ec834d4be0f6f5ccaab415df75336a992aceb7eeeb14fdf096a9e9c"
"https://plugins.dprint.dev/markdown-0.17.0.wasm"
]
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
nil
nixfmt-rfc-style
dprint
yamlfmt
typos
];
};
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
line_ending: lf
formatter:
type: basic
retain_line_breaks_single: true
# https://github.com/google/yamlfmt/issues/182
scan_folded_as_literal: true

0 comments on commit 53407a1

Please sign in to comment.