Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: adopt markdownlint and markdown-table-formatter for *.md#15831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 94 commits intomainfromatif/bye-bye-prettier
Jan 3, 2025

Conversation

matifali
Copy link
Member

@matifalimatifali commentedDec 11, 2024
edited
Loading

Removed dependence onprettier in favor ofmarkdownlint andmarkdown-table-formatter for markdown files.

EdwardAngertand others added20 commitsNovember 25, 2024 16:51
Co-authored-by: Muhammad Atif Ali <atif@coder.com>
- Replace Prettier with markdownlint for documentation formatting.- Rename `docs-pr.yaml` to `docs-lint.yaml` for clarity.- Adjust `Makefile` to use `fmt/biome` instead of `fmt/prettier`.- Remove `.prettierignore` and `.prettierignore.include` files.- Apply markdownlint formatting across relevant documentation files.
- Restrict triggers to main branch and pull requests- Remove automatic fix option in markdownlint-cli2 command
@matifalimatifali marked this pull request as draftDecember 11, 2024 15:47
@matifalimatifali removed the request for review fromEdwardAngertDecember 11, 2024 15:47
@matifalimatifaliforce-pushed theatif/bye-bye-prettier branch 2 times, most recently from3d065a5 to4cd592bCompareDecember 11, 2024 15:52
- Update `setup-node` action to specify pnpm version.- Remove redundant node_modules installation command.- Use specific commit hashes for action versions in workflows.- Adjust paths in Makefile for better file management.
Copy link
Contributor

@EdwardAngertEdwardAngert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

amazing- thanks@matifali !

🚀

@EdwardAngertEdwardAngert added the docsArea: coder.com/docs labelDec 31, 2024
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I note a number of heading changes (e.g.# =>##) -- are we sure this won't break any existing documentation links?

@matifali
Copy link
MemberAuthor

matifali commentedJan 2, 2025
edited
Loading

I note a number of heading changes (e.g. # => ##) -- are we sure this won't break any existing documentation links?

There is a Markdown rule against having multiple H1 headings in a file. Yes, it will not break Markdown anchors, which are independent of heading levels.
@EdwardAngert can confirm this.

EdwardAngert reacted with thumbs up emoji

-name:lint
if:steps.changed-files.outputs.any_changed == 'true'
run:|
pnpm exec markdownlint-cli2 ${{ steps.changed-files.outputs.all_changed_files }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This works now but could at some point fail with a shell error: argument list too long. Using xargs is one option and maybe markdown-lint has some other built-in function.

If a file has spaces that would also be problematic.

if:steps.changed-files.outputs.any_changed == 'true'
run:|
# markdown-table-formatter requires a space separated list of files
echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ',' '\n' | pnpm exec markdown-table-formatter --check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same as before, you could just add xargs in front of pnpm here. You could use null instead of newline (tr , ’\0’,xargs -0) for additional safety. For ultimate safety, store files in env via yaml and echo the env in addition to null handling and all bases are covered.

Copy link
Contributor

@EdwardAngertEdwardAngertJan 2, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I like this - seems like it might make it easier to debug issues later too

something like a commented out debug line that writes the env contents into a file? is that possible/useful?

I'm not sure what it would specifically look like or if it's acat orecho (printf?) thing, but something like:

cat<<<"$changed-files">"list-changed-files.txt"

Copy link
MemberAuthor

@matifalimatifaliJan 3, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@mafredri I am leaving the suggestions here out of this PR. I need to learn the risks here and can address them in a follow-up PR. I also welcome you taking a jab at this.

@@ -0,0 +1,18 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Does this file support json comment syntax? If yes, might be nice to detail why we change some of these rules. Otherwise it's could be nice to stick to stock settings as close as possible, given that it has sane defaults.

matifali and EdwardAngert reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will add comments and convert to*.jsonc.

@@ -20,7 +20,7 @@
"playwright:install": "playwright install --with-deps chromium",
"playwright:test": "playwright test --config=e2e/playwright.config.ts",
"playwright:test-ui": "playwright test --config=e2e/playwright.config.ts --ui $([[ \"$CODER\" == \"true\" ]] && echo --ui-port=7500 --ui-host=0.0.0.0)",
"gen:provisioner": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./e2e/ --ts_proto_opt=outputJsonMethods=false,outputEncodeMethods=encode-no-creation,outputClientImpl=false,nestJs=false,outputPartialMethods=false,fileSuffix=Generated,suffix=hey -I ../provisionersdk/proto ../provisionersdk/proto/provisioner.proto && pnpm exec prettier --ignore-path '/dev/null' --cache --write './e2e/provisionerGenerated.ts'",
"gen:provisioner": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./e2e/ --ts_proto_opt=outputJsonMethods=false,outputEncodeMethods=encode-no-creation,outputClientImpl=false,nestJs=false,outputPartialMethods=false,fileSuffix=Generated,suffix=hey -I ../provisionersdk/proto ../provisionersdk/proto/provisioner.proto",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I see prettier was removed here, but no alternative given it its place?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

./e2e/provisionerGenerated.ts is a generated file so should not format I guess.
This is already in the ignore list of biome.

"e2e/**/*Generated.ts",

--postgres-auth password|awsiamrds, $CODER_PG_AUTH (default: password)
Type of auth to use when connecting to postgres. For AWS RDS, using
IAM authentication (awsiamrds) is recommended.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

These files must not be changed, probably best to not touch anything in anytestdata folder. Although, if they changed as a result of changing the Go files then that's OK.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What is the best way to do that?
These files are generated from code and so does the API and CLI docs. And to make the docs follow the rules this is an artifact.

I will further explore how best to deal with this.

WARN = 3,
ERROR = 4,
UNRECOGNIZED = -1,
TRACE = 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This file is incorrectly indented. It'll be annoying if a developer is making local changes here and the whole file is reformatted.

@EdwardAngert
Copy link
Contributor

@johnstcn

I note a number of heading changes (e.g. # => ##) -- are we sure this won't break any existing documentation links?

@matifali

There is a Markdown rule against having multiple H1 headings in a file. Yes, it will not break Markdown anchors, which are independent of heading levels.@EdwardAngert can confirm this.

+1 to what@matifali says here - totally reasonable question and good catch though. Whatever the number of# in the markdown, they all anchor as a single# in the URL (which is why there's anotherrule against duplicate headings - it would just link to the first instance). If we have a table of contents on any pages, those might potentially look a little different, but it shouldn't affect anything in terms of navigation

Added path exclusions to resolve issues with table formatting in `api/schema.md` and `api/templates.md`.
@bpmct
Copy link
Member

wow

@matifalimatifalienabled auto-merge (squash)January 3, 2025 12:10
"out/",
"test-results/",
"e2e/**/*Generated.ts",
"src/api/*Generated.ts",
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

removing as we want to lint/fmt these files.

@matifalimatifalienabled auto-merge (squash)January 3, 2025 13:05
@matifalimatifali merged commit94f5d52 intomainJan 3, 2025
36 of 37 checks passed
@matifalimatifali deleted the atif/bye-bye-prettier branchJanuary 3, 2025 13:13
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 3, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@johnstcnjohnstcnjohnstcn approved these changes

@aslilacaslilacAwaiting requested review from aslilacaslilac is a code owner

+1 more reviewer

@EdwardAngertEdwardAngertEdwardAngert approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@matifalimatifali

Labels

docsArea: coder.com/docs

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@matifali@EdwardAngert@aslilac@bpmct@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp