@@ -414,7 +414,7 @@ BOLD := $(shell tput bold 2>/dev/null)
414
414
GREEN := $(shell tput setaf 2 2>/dev/null)
415
415
RESET := $(shell tput sgr0 2>/dev/null)
416
416
417
- fmt : fmt/ts fmt/go fmt/terraform fmt/shfmt fmt/prettier
417
+ fmt : fmt/ts fmt/go fmt/terraform fmt/shfmt fmt/biome fmt/markdown
418
418
.PHONY : fmt
419
419
420
420
fmt/go :
@@ -438,15 +438,16 @@ else
438
438
endif
439
439
.PHONY : fmt/ts
440
440
441
- fmt/prettier : .prettierignore
442
- echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/prettier$( RESET) "
441
+ fmt/biome :
442
+ echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/biome$( RESET) "
443
+ cd site
443
444
# Avoid writing files in CI to reduce file write activity
444
445
ifdef CI
445
446
pnpm run format:check
446
447
else
447
448
pnpm run format
448
449
endif
449
- .PHONY : fmt/prettier
450
+ .PHONY : fmt/biome
450
451
451
452
fmt/terraform : $(wildcard * .tf)
452
453
echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/terraform$( RESET) "
@@ -463,7 +464,13 @@ else
463
464
endif
464
465
.PHONY : fmt/shfmt
465
466
466
- lint : lint/shellcheck lint/go lint/ts lint/examples lint/helm lint/site-icons
467
+ fmt/markdown :
468
+ echo " $( GREEN) ==>$( RESET) $( BOLD) fmt/markdown$( RESET) "
469
+ ./scripts/pnpm_install.sh
470
+ pnpm format-docs
471
+ .PHONY : fmt/markdown
472
+
473
+ lint : lint/shellcheck lint/go lint/ts lint/examples lint/helm lint/site-icons lint/markdown
467
474
.PHONY : lint
468
475
469
476
lint/site-icons :
@@ -497,6 +504,11 @@ lint/helm:
497
504
make lint
498
505
.PHONY : lint/helm
499
506
507
+ lint/markdown :
508
+ ./scripts/pnpm_install.sh
509
+ pnpm lint-docs
510
+ .PHONY : lint/markdown
511
+
500
512
# All files generated by the database should be added here, and this can be used
501
513
# as a target for jobs that need to run after the database is generated.
502
514
DB_GEN_FILES := \
@@ -530,8 +542,6 @@ GEN_FILES := \
530
542
docs/reference/cli/index.md \
531
543
docs/admin/security/audit-logs.md \
532
544
coderd/apidoc/swagger.json \
533
- .prettierignore.include \
534
- .prettierignore \
535
545
provisioner/terraform/testdata/version \
536
546
site/e2e/provisionerGenerated.ts \
537
547
site/src/theme/icons.json \
@@ -566,8 +576,6 @@ gen/mark-fresh:
566
576
docs/reference/cli/index.md \
567
577
docs/admin/security/audit-logs.md \
568
578
coderd/apidoc/swagger.json \
569
- .prettierignore.include \
570
- .prettierignore \
571
579
site/e2e/provisionerGenerated.ts \
572
580
site/src/theme/icons.json \
573
581
examples/examples.gen.json \
@@ -648,6 +656,9 @@ vpn/vpn.pb.go: vpn/vpn.proto
648
656
site/src/api/typesGenerated.ts : $(wildcard scripts/apitypings/* ) $(shell find ./codersdk $(FIND_EXCLUSIONS ) -type f -name '* .go')
649
657
# -C sets the directory for the go run command
650
658
go run -C ./scripts/apitypings main.go > $@
659
+ cd site
660
+ ../scripts/pnpm_install.sh
661
+ pnpm exec biome format --write src/api/typesGenerated.ts
651
662
652
663
site/e2e/provisionerGenerated.ts : provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go
653
664
cd site
@@ -656,8 +667,9 @@ site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisio
656
667
657
668
site/src/theme/icons.json : $(wildcard scripts/gensite/* ) $(wildcard site/static/icon/* )
658
669
go run ./scripts/gensite/ -icons " $@ "
659
- ./scripts/pnpm_install.sh
660
- pnpm -C site/ exec biome format --write src/theme/icons.json
670
+ cd site
671
+ ../scripts/pnpm_install.sh
672
+ pnpm exec biome format --write src/theme/icons.json
661
673
662
674
examples/examples.gen.json : scripts/examplegen/main.go examples/examples.go $(shell find ./examples/templates)
663
675
go run ./scripts/examplegen/main.go > examples/examples.gen.json
@@ -676,29 +688,45 @@ codersdk/rbacresources_gen.go: scripts/typegen/codersdk.gotmpl scripts/typegen/m
676
688
677
689
site/src/api/rbacresourcesGenerated.ts : scripts/typegen/codersdk.gotmpl scripts/typegen/main.go coderd/rbac/object.go coderd/rbac/policy/policy.go
678
690
go run scripts/typegen/main.go rbac typescript > " $@ "
691
+ cd site
692
+ ../scripts/pnpm_install.sh
693
+ pnpm exec biome format --write src/api/rbacresourcesGenerated.ts
679
694
680
695
site/src/api/countriesGenerated.ts : scripts/typegen/countries.tstmpl scripts/typegen/main.go codersdk/countries.go
681
696
go run scripts/typegen/main.go countries > " $@ "
697
+ cd site
698
+ ../scripts/pnpm_install.sh
699
+ pnpm exec biome format --write src/api/countriesGenerated.ts
682
700
683
701
docs/admin/integrations/prometheus.md : scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
684
702
go run scripts/metricsdocgen/main.go
685
703
./scripts/pnpm_install.sh
686
- pnpm exec prettier --write ./docs/admin/integrations/prometheus.md
704
+ pnpm exec markdownlint-cli2 --fix ./docs/admin/integrations/prometheus.md
705
+ pnpm exec markdown-table-formatter ./docs/admin/integrations/prometheus.md
687
706
688
707
docs/reference/cli/index.md : scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES )
689
708
CI=true BASE_PATH=" ." go run ./scripts/clidocgen
690
709
./scripts/pnpm_install.sh
691
- pnpm exec prettier --write ./docs/reference/cli/index.md ./docs/reference/cli/* .md ./docs/manifest.json
710
+ pnpm exec markdownlint-cli2 --fix ./docs/reference/cli/* .md
711
+ pnpm exec markdown-table-formatter ./docs/reference/cli/* .md
712
+ cd site
713
+ ../scripts/pnpm_install.sh
714
+ pnpm exec biome format --write ../docs/manifest.json
692
715
693
716
docs/admin/security/audit-logs.md : coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
694
717
go run scripts/auditdocgen/main.go
695
718
./scripts/pnpm_install.sh
696
- pnpm exec prettier --write ./docs/admin/security/audit-logs.md
719
+ pnpm exec markdownlint-cli2 --fix ./docs/admin/security/audit-logs.md
720
+ pnpm exec markdown-table-formatter ./docs/admin/security/audit-logs.md
697
721
698
722
coderd/apidoc/swagger.json : $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS ) -type f) $(wildcard coderd/* .go) $(wildcard enterprise/coderd/* .go) $(wildcard codersdk/* .go) $(wildcard enterprise/wsproxy/wsproxysdk/* .go) $(DB_GEN_FILES ) .swaggo docs/manifest.json coderd/rbac/object_gen.go
699
723
./scripts/apidocgen/generate.sh
700
724
./scripts/pnpm_install.sh
701
- pnpm exec prettier --write ./docs/reference/api ./docs/manifest.json ./coderd/apidoc/swagger.json
725
+ pnpm exec markdownlint-cli2 --fix ./docs/reference/api/* .md
726
+ pnpm exec markdown-table-formatter ./docs/reference/api/* .md
727
+ cd site
728
+ ../scripts/pnpm_install.sh
729
+ pnpm exec biome format --write ../docs/manifest.json ../coderd/apidoc/swagger.json
702
730
703
731
update-golden-files : \
704
732
cli/testdata/.gen-golden \
@@ -769,15 +797,6 @@ provisioner/terraform/testdata/version:
769
797
fi
770
798
.PHONY : provisioner/terraform/testdata/version
771
799
772
- # Combine .gitignore with .prettierignore.include to generate .prettierignore.
773
- .prettierignore : .gitignore .prettierignore.include
774
- echo " # Code generated by Makefile ($^). DO NOT EDIT." > " $@ "
775
- echo " " >> " $@ "
776
- for f in $^; do
777
- echo " # $$ {f}:" >> " $@ "
778
- cat " $$ f" >> " $@ "
779
- done
780
-
781
800
test :
782
801
$(GIT_FLAGS ) gotestsum --format standard-quiet -- -v -short -count=1 ./...
783
802
.PHONY : test
0 commit comments