Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format:check crashes due to the number of changed files #23467

Open
1 of 4 tasks
work933k opened this issue May 17, 2024 · 0 comments
Open
1 of 4 tasks

format:check crashes due to the number of changed files #23467

work933k opened this issue May 17, 2024 · 0 comments
Assignees
Labels

Comments

@work933k
Copy link

Current Behavior

In our CI-pipeline we give the command npx nx format:check, just to ensure that all files are correctly formatted.
This command normally works without a problem.
For a PR with >3300 modified files (formatting changes) the process crashes and exits with exitcode "1".
When i do the NODE_DEBUG=* npx nx format:check i see the following in the console:

CHILD_PROCESS 57502: spawnSync [Object: null prototype] {
  maxBuffer: 1048576,
  stdio: [ 0, 1, 2 ],
  shell: true,
  args: [
    '/bin/sh',
    '-c',
    'node "/root/DummyNx/node_modules/prettier/bin/prettier.cjs" --list-different ".prettierrc.json" ".storybook/global-parameters.ts" ".storybook/injectInjectorToProps.ts" ".storybook/language.decorators.ts" ".storybook/main.ts" ".storybook/modes.ts" ".storybook/viewports.ts" ".storybook/dummy-advisor.decorators.ts" ".storybook/duymmy.decorators.ts" "apps/advisor-dummy-app-e2e/cypress.config.ts", <many filepaths> ... 307637 more characters
  ],

Expected Behavior

I would expect this not to be an issue.

Maybe it would be a good idea to have "format:check" to split it in pairs of xxx files? Or maybe give a warning when above a certain number of files (1000).

GitHub Repo

No response

Steps to Reproduce

  1. Take a very big repo
  2. Modify a prettier/eslint setting (tab from 2 to 3 spaces)
  3. Run npx nx format:write --all or npx run-many --all --target=lint --fix
  4. Run npx nx format:check
  5. In my situation i get no console output, but do get the exit-code "1" (failed)

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : linux-x64
npm    : 10.5.0

nx                 : 18.2.4
@nx/js             : 18.2.4
@nx/jest           : 18.2.4
@nx/linter         : 18.2.4
@nx/eslint         : 18.2.4
@nx/workspace      : 18.2.4
@nx/angular        : 18.2.4
@nx/cypress        : 18.2.4
@nx/devkit         : 18.2.4
@nx/eslint-plugin  : 18.2.4
@nx/express        : 18.2.4
@nx/node           : 18.2.4
@nx/plugin         : 18.2.4
@nx/storybook      : 18.2.4
@nrwl/tao          : 18.2.4
@nx/web            : 18.2.4
@nx/webpack        : 18.2.4
typescript         : 5.4.3
---------------------------------------
Community plugins:
@compodoc/compodoc     : 1.1.24
@ngrx/component-store  : 17.0.1
@ngrx/effects          : 17.0.1
@ngrx/entity           : 17.0.1
@ngrx/eslint-plugin    : 17.0.1
@ngrx/router-store     : 17.0.1
@ngrx/schematics       : 17.0.1
@ngrx/store            : 17.0.1
@ngrx/store-devtools   : 17.0.1
@spaceribs/nx-betterer : 3.0.0
@storybook/angular     : 7.6.17
ng-mocks               : 14.12.2
nx-stylelint           : 17.1.4
---------------------------------------
Local workspace plugins:
         @athora-nx/storybook-test-runner
         @athora-nx/static-server
         @athora-nx/azuredevops
         @athora-nx/chromatic
         @athora-nx/workspace-plugin
         @athora-nx/coverage

npm ls prettier
dummy-nx@0.1.0 /root/dummy
├─┬ @betterer/betterer@5.4.0
│ └── prettier@2.8.8
├─┬ @storybook/cli@7.6.17
│ ├─┬ @storybook/codemod@7.6.17
│ │ └── prettier@2.8.8
│ └── prettier@2.8.8
└── prettier@3.2.5

Failure Logs

No response

Package Manager Version

10.5.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I love working with NX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants