Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dprint prettier plugin with yamlfmt #75

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ updates:
determinatesystems-actions:
patterns:
- 'DeterminateSystems*'
# TODO: Consider to enable this feature after realized CI
# - package-ecosystem: 'docker'
# directory: '/'
# schedule:
# interval: 'monthly'
# TODO: Consider to enable this feature after realized CI
# - package-ecosystem: 'docker'
# directory: '/'
# schedule:
# interval: 'monthly'
10 changes: 10 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>kachick/renovate-config-dprint#1.1.0"
],
"labels": ["dependencies", "renovate"],
"nix": {
"enabled": false
}
}
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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-24.04
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"editorconfig.editorconfig",
"tekumara.typos-vscode",
"dprint.dprint",
"kachick.vscode-yamlfmt",
"jnoortheen.nix-ide",
"ms-azuretools.vscode-docker"
]
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.enableLanguageServer": true,
"nix.serverPath": "nil",
"nix.serverSettings": {
Expand Down
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ tasks:
cmds:
- dprint fmt
- nixpkgs-fmt ./*.nix
- yamlfmt .
- shfmt --write ./images/*/*.bash
lint:
cmds:
- dprint check
- yamlfmt -lint .
- typos . .github .vscode
- nixpkgs-fmt --check ./*.nix
- trivy config --exit-code 1 .
Expand All @@ -39,5 +41,6 @@ tasks:
- nil --version
- task --version
- dprint --version
- yamlfmt -version
- typos --version
- trivy --version
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
nixpkgs-fmt
go-task
dprint
yamlfmt
typos
shfmt
shellcheck
Expand Down
2 changes: 1 addition & 1 deletion images/ubuntu-nix-systemd/try.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euxo pipefail
image_tag=ubuntu-nix-systemd
user="$1"

podman build --tag "$image_tag" --build-arg username="$user" --file "./images/${image_tag}/Containerfile" .
podman build --tag "$image_tag" --build-arg username="$user" --file "./images/${image_tag}/Containerfile" .
container_id="$(podman run --rm --detach "$image_tag")"
sleep 1 # Wait systemd to be ready
podman exec --user "$user" --interactive --tty "$container_id" bash
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
Loading