ci: enforce prettier formatting #488

merged
opened by winter.bsky.social targeting master from push-pzwzzlwkkpnw
Changed files
+30
.tangled
workflows
+13
.prettierignore
···
+
flake.lock
+
+
# for now, we don't want these formatted, but let's consider it in the future?
+
*.json
+
*.md
+
*.yml
+
*.yaml
+
*.jsonc
+
*.json
+
+
# causes Go template plugin errors: https://github.com/NiklasPor/prettier-plugin-go-template/issues/120
+
appview/pages/templates/layouts/repobase.html
+
appview/pages/templates/repo/tags.html
+10
.prettierrc
···
+
{
+
"overrides": [
+
{
+
"files": ["*.html"],
+
"options": {
+
"parser": "go-template"
+
}
+
}
+
]
+
}
+3
.tangled/workflows/fmt.yml
···
unformatted=$(gofmt -l .)
test -z "$unformatted" || (echo "$unformatted" && exit 1)
+
- name: "prettier"
+
command: |
+
nix develop -c "prettier -c ."
+4
flake.nix
···
pkgs.redis
pkgs.coreutils # for those of us who are on systems that use busybox (alpine)
packages'.lexgen
+
(pkgs.runCommand "prettier-wrapper" {nativeBuildInputs = [pkgs.makeWrapper];} ''
+
mkdir -p "$out/bin"
+
makeWrapper ${pkgs.prettier}/bin/prettier "$out/bin/prettier" --add-flags "--plugin=${pkgs.prettier-plugin-go-template}/lib/node_modules/prettier-plugin-go-template/lib/index.js"
+
'')
];
shellHook = ''
mkdir -p appview/pages/static