Skip to content

Commit

Permalink
Replace dprint prettier plugin with yamlfmt and 3rd-party WASM plugins (
Browse files Browse the repository at this point in the history
#114)

* Replace dprint prettier plugin with yamlfmt and 3rd-party WASM plugins

* Enable renovatebot for updating dprint plugins
  • Loading branch information
kachick authored May 20, 2024
1 parent 07e2ea9 commit 02bac9b
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 12 deletions.
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
}
}
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
with:
dprint-version: '0.45.1' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","dprint --version | cut -d ' ' -f 2"]}
- uses: crate-ci/[email protected] # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["bash","-c","typos --version | cut -d ' ' -f 2"]}
- 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
- uses: denoland/setup-deno@v1
with:
deno-version: '1.43.1' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
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",
"denoland.vscode-deno"
]
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"
},
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"tasks": {
"build": "deno run --quiet --allow-net --allow-read --allow-write --allow-env scripts/build.ts",
"clean": "rm -rf ./dist",
"check": "dprint check && typos && deno fmt --check && deno lint && deno check src/*.ts* scripts/*.ts && deno task check:manifest",
"check": "dprint check && typos && deno fmt --check && deno lint && yamlfmt -lint . && deno check src/*.ts* scripts/*.ts && deno task check:manifest",
"check:manifest": "deno run scripts/manifestValidator.ts",
"stylelint": "deno task cache:stylelint && deno run --node-modules-dir --allow-env --allow-read --allow-sys npm:[email protected]/stylelint src/*.css | deno run --allow-sys scripts/checkEmpty.ts",
"deps": "deno --version && mogrify --version && dprint --version && typos --version && rg --version",
Expand Down
8 changes: 4 additions & 4 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"json": {},
"markdown": {},
"prettier": {
"printWidth": 120,
"singleQuote": true
"malva": {
"quotes": "preferSingle"
},
"excludes": ["*.ts*", "dist/", "node_modules/", ".git/", "vendor/"],
"plugins": [
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.16.4.wasm",
"https://plugins.dprint.dev/toml-0.6.1.wasm",
"https://plugins.dprint.dev/prettier-0.39.0.json@896b70f29ef8213c1b0ba81a93cee9c2d4f39ac2194040313cd433906db7bc7c"
"https://plugins.dprint.dev/g-plane/malva-v0.4.0.wasm",
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.8.0.wasm"
]
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

dprint
deno
yamlfmt
ripgrep
typos

Expand Down
7 changes: 4 additions & 3 deletions src/github-patcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ a[href$='/watchers'] strong,
#repo-network-counter,
#repo-notifications-counter,
/* Do not hide other endpoints like `api/top-langs` */
a:has(> img[data-canonical-src^='https://github-readme-stats.vercel.app/api?'])
{
a:has(> img[data-canonical-src^='https://github-readme-stats.vercel.app/api?']) {
display: none;
}

li:has(> a[href$='/followers']),
div:has(> h2 a[href$='?tab=achievements']),
aside[aria-label='Explore'] div[aria-label='Explore repositories'] div:has(> svg[aria-label='star']) {
aside[aria-label='Explore']
div[aria-label='Explore repositories']
div:has(> svg[aria-label='star']) {
display: none !important;
}
9 changes: 5 additions & 4 deletions src/options.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -9,9 +9,10 @@
<body>
<div class="Header">
<div class="Header-item">
<a href="https://chrome.google.com/webstore/detail/depop/bblbchjekobacogfioehogggccfagkmk" class="Header-link"
><span>depop</span></a
>
<a
href="https://chrome.google.com/webstore/detail/depop/bblbchjekobacogfioehogggccfagkmk"
class="Header-link"
><span>depop</span></a>
</div>
</div>
<main>
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 02bac9b

Please sign in to comment.