NixOS / nixos-homepage

Sources for nixos.org
https://nixos.org
285 stars 305 forks source link

Format/init #1489

Open hsjobeki opened 2 days ago

hsjobeki commented 2 days ago

Adds formatting checks to the CI

with using "prettier" with "prettier-plugin-astro"

Locally developers can run:

nix run .#format to format the src directory`

Alternatively / Additionally:

Use any LSP that has prettier support.

or run:

npm run format npm run format:check

Ci executes:

nix build .\#checks.x86_64-linux.format

Which fails if the formatting is not in the required format which will ensure the format stays consistent.

hsjobeki commented 2 days ago

Maybe we should use treefmt and override the prettier package there... (Could be another PR ? ) If done right the astro formatting would not change

tomberek commented 1 day ago

I've not looked at the workflow yet, but likely would want a .git-blame-ignore-revs