I m stuck in a weird loo…

1 minute read

I’m stuck in a weird loop with the pre push hooks for prettier and yarn documentation.

When I run yarn format it modifies a couple of the generated .md files (docs/angular/cli/migrate.md and docs/react/cli/migrate.md), just removing an extra empty line (following line 6 where it says Run migrations…`), fair enough.

When I try to push and the yarn documentation script runs, the extra lines are re-added resulting in a failed push. Done generating all Documentation :page_facing_up: Documentation has been modified, you need to commit the changes. M docs/angular/cli/migrate.md M docs/react/cli/migrate.md error Command failed with exit code 1. I add these changes by yarn documentation to the commit and try again to push, prettier dislikes my changes resulting in a failed push. Done generating all Documentation :page_facing_up: Documentation not modified :sparkles: Done in 15.94s. :mag: Finding changed files since git revision e43229a2. :dart: Found 64 changed files. :no_entry: Check failed: docs/angular/cli/migrate.md :no_entry: Check failed: docs/react/cli/migrate.md ✗ Code style issues found in the above file(s). Forgot to run Prettier? I then run yarn format which brings us back to the beginning.

I got around this to push my changes into my PR for now with --no-verify but I assume this is not correct behaviour? It’s worth mentioning I did not change anything to cause any changes to these migrate documentation files.


If it helps, this is the branch in question


interesting, after formatting packages/workspace/src/command-line/nx-commands.ts (manually, prettier didn’t catch it) the problem seems to have disappeared

The changes in question (removing some trailing whitespace)


Probably need to rebase the latest máster

<https://github.com/nrwl/nx/commit/b9953b4c0be550f7c602d9f911b7197056f7aaf8 https://github.com/nrwl/nx/commit/b9953b4c0be550f7c602d9f911b7197056f7aaf8> this is the fix

That branch was already rebased and included that fix. Not sure why it kept being an issue for a minute there but ended up working out :slightly_smiling_face: Thanks though