[tooling] Maintenance required re: automatic context fixes
What happened? Describe the problem that occurred.
When reviewing the Fix content issues automatically guidance in Contributing.md, commands are not working as expected.
-
npm run test-and-fixdoes alert to formatting issues, but does not automatically fix them as the script name implies. -
the
fix:allscript is documented, but when run, an error returns that it doesn't exist.
What did you expect would happen? Describe the expected result/output.
For 1 - I expect formatting issues to be found AND fixed via Prettier.
For 2 - I expect that running npm run test-and-fix results in a found script that runs without errors.
Additional context: anything else you can think about that would be helpful.
Output error for 1:
The following output appeared for me when I ran npm run test-and-fix:
% npm run test-and-fix
test-and-fix npm run seq -- check fix:dict fix:filenames
seq bash -c 'for cmd in "$@"; do npm run $cmd || exit 1; done' - "check" "fix:dict" "fix:filenames"
check npm run seq -- $(npm run -s _list:check:*)
seq bash -c 'for cmd in "$@"; do npm run $cmd || exit 1; done' - "check:filenames" "check:format" "check:links" "check:markdown" "check:spelling" "check:text"
check:filenames test -z "$(npm run -s _ls-bad-filenames)" || npm run -s _filename-error
check:format npm run _check:format || (echo '[help] Run: npm run fix:format'; exit 1)
_check:format npx prettier --check .
Checking formatting... [warn] content/en/docs/security/otel-collector-configuration-best-practices.md [warn] Code style issues found in the above file. Run Prettier to fix. [help] Run: npm run fix:format
Output error for 2:
npm ERR! Missing script: "fix:all" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run
Thank you for raising this issue. I was facing this problem as well and worked around it by running fix:format first and then test-and-fix, but this shouldn't be the way how it works I guess, maybe we need to do something like "fix:all, check, fix:all"