-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Labels
Area: Tooling/GatsbyFixes that require working with the CI, styles, or site generatorFixes that require working with the CI, styles, or site generatorType: BugSomething doesn't work how it shouldSomething doesn't work how it should
Description
In the current version of the documentation published at https://k6.io/docs/, all the code examples are formatted using Prettier, according to the .prettierrc
file at the project's root. When making a commit, if the code examples modification does not match the prettier formatting rules, a git hook blocks the commit.
With the switch to the new Hugo-based documentation, this workflow seems broken. I could also test and commit code examples not matching our prettier rules successfully (without the hook blocking it).
Having a common configuration for all our examples has been a good practice in keeping the code we present to users consistent, and we should work on bringing back the prettier checks as part of the workflow.
heitortsergent
Metadata
Metadata
Assignees
Labels
Area: Tooling/GatsbyFixes that require working with the CI, styles, or site generatorFixes that require working with the CI, styles, or site generatorType: BugSomething doesn't work how it shouldSomething doesn't work how it should
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
oleiade commentedon Nov 13, 2023
Sharing a finding: prettier supports markdown natively with the
--parser markdown
command-line option. I've tested it over some of our documentation by intentionally making it not match our config, and it does what you would expect.oleiade commentedon Nov 13, 2023
More context: my understanding that commit hooks in the repository are currently managed by the husky tool, which is configured in the
.husky
folder of the repo.Our husky config consists in calling the lint-staged tool.
oleiade commentedon Nov 13, 2023
Adding the following to the
.lintstagedrc
file seems to help: