diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc1358a..1114ebc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: 🦕 +name: 👕 on: push: branches: [main] @@ -12,18 +12,39 @@ jobs: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: - deno-version: '1.43.1' # selfup { "regex": "\\d[^']+", "script": "deno --version | head -n 1 | cut -d ' ' -f 2" } + deno-version: '1.43.1' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1"],"nth": 2} - run: deno task stylelint - check: + dprint: timeout-minutes: 10 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dprint/check@v2.2 with: - dprint-version: '0.45.1' # selfup { "regex": "\\d[^']+", "script": "dprint --version | cut -d ' ' -f 2" } + dprint-version: '0.45.1' # selfup { "extract": "\\d[^']+", "replacer": ["dprint", "--version"], "nth": 2 } + + deno: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: - deno-version: '1.43.1' # selfup { "regex": "\\d[^']+", "script": "deno --version | head -n 1 | cut -d ' ' -f 2" } + deno-version: '1.43.1' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1"],"nth": 2} - run: deno task check + + yamlfmt: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + # yamlfmt still uses this ver for the distribution + go-version: '1.18' + - name: Install yamlfmt + # TODO: Apply selfup after https://github.com/google/yamlfmt/pull/180 + run: go install github.com/google/yamlfmt/cmd/yamlfmt@v0.12.1 + - run: yamlfmt -lint . diff --git a/.github/workflows/merge-bot-pr.yml b/.github/workflows/merge-bot-pr.yml index 0a16abd..9213b26 100644 --- a/.github/workflows/merge-bot-pr.yml +++ b/.github/workflows/merge-bot-pr.yml @@ -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] diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index e964e2c..2da9fa5 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,7 +5,7 @@ on: paths: - '.github/workflows/pages.yml' - 'public/**' - # Allows you to run this workflow manually from the Actions tab + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: diff --git a/.github/workflows/update-flake-lock-and-ci.yml b/.github/workflows/update-flake-lock-and-ci.yml index 03233d2..d12cb61 100644 --- a/.github/workflows/update-flake-lock-and-ci.yml +++ b/.github/workflows/update-flake-lock-and-ci.yml @@ -11,7 +11,7 @@ on: jobs: update-nixpkgs: - uses: kachick/selfup/.github/workflows/reusable-bump-flake-lock-and-selfup.yml@action-v1 + uses: kachick/selfup/.github/workflows/reusable-bump-flake-lock-and-selfup.yml@v1.1.2 if: (github.event.sender.login == 'kachick') || (github.event_name != 'pull_request') with: dry-run: ${{ github.event_name == 'pull_request' }} diff --git a/deno.jsonc b/deno.jsonc index d0923fc..8a4f210 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,21 +1,22 @@ { "tasks": { "serve": "deno run --allow-net --allow-read https://deno.land/std@0.217.0/http/file_server.ts public", - "check": "dprint check && deno fmt --check && deno lint && deno check scripts/*.ts", + "check": "deno fmt --check && deno lint && deno check scripts/*.ts", // If you want to keep stylelint color print in local, Use `unbuffer deno run --node-modules-dir ...` "stylelint": "deno task cache && deno run --node-modules-dir --allow-env --allow-read --allow-sys npm:stylelint@16.2.1/stylelint **/*.css | deno run --allow-sys scripts/isEmpty.ts", + "check-all": "dprint check && yamlfmt -lint . && deno task stylelint && deno task check", "deps": "nix --version && nil --version && deno --version && dprint --version", "cache": "deno cache --node-modules-dir npm:stylelint@16.2.1 npm:stylelint-config-recommended@14.0.0", - "fmt": "deno fmt && dprint fmt && nix fmt ./*.nix" + "fmt": "deno fmt && dprint fmt && yamlfmt . && nix fmt ./*.nix", }, "lint": { "include": ["scripts/"], "rules": { - "tags": ["recommended"] - } + "tags": ["recommended"], + }, }, "fmt": { "singleQuote": true, - "include": ["scripts/"] - } + "include": ["scripts/"], + }, } diff --git a/dprint.json b/dprint.json index 4076a72..392ea6d 100644 --- a/dprint.json +++ b/dprint.json @@ -3,16 +3,16 @@ }, "markdown": { }, - "prettier": { - "printWidth": 120, - "singleQuote": true + "malva": { + "quotes": "preferSingle" }, "excludes": [ "**/*-lock.json" ], "plugins": [ - "https://plugins.dprint.dev/json-0.17.4.wasm", - "https://plugins.dprint.dev/markdown-0.16.0.wasm", - "https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe" + "https://plugins.dprint.dev/json-0.19.2.wasm", + "https://plugins.dprint.dev/markdown-0.17.0.wasm", + "https://plugins.dprint.dev/g-plane/malva-v0.3.1.wasm", + "https://plugins.dprint.dev/g-plane/markup_fmt-v0.8.0.wasm" ] } diff --git a/flake.nix b/flake.nix index ccb1565..c06f89a 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,7 @@ edge-pkgs.deno edge-pkgs.dprint edge-pkgs.typos + edge-pkgs.yamlfmt edge-pkgs.go-task ]; }; diff --git a/public/index.html b/public/index.html index dfac5b0..6a688cb 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,10 @@ - +
diff --git a/yamlfmt.yml b/yamlfmt.yml new file mode 100644 index 0000000..64cfb26 --- /dev/null +++ b/yamlfmt.yml @@ -0,0 +1,5 @@ +gitignore_excludes: true +line_ending: lf +formatter: + type: basic + retain_line_breaks_single: true