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

fix: support file list input for format command to bypass OS limits #391

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

mrmeku
Copy link
Contributor

@mrmeku mrmeku commented Sep 16, 2024

Add support for '@file' syntax to read format targets from a file Implement batch processing to handle large numbers of files Maintain compatibility with direct command-line arguments

This change allows the format command to process an arbitrarily large number of files by reading targets from a file, bypassing OS command line length limits. It addresses issues with pre-commit hooks and other tooling when formatting many files at once.
Note: This introduces a limitation where files starting with '@' cannot be directly specified as format targets. Users must use the full file path for such files.

Closes #387


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes/no
  • Breaking change (forces users to change their own code or config): yes
  • Suggested release notes appear below: yes

Test plan

  • Manual testing; please provide instructions so we can reproduce:
    Manually ran the script with @args.txt which 400,000 lines of package.json. The file was formatted 40 times as expected and the OS limit for line length was not reached.

Support for '@file' syntax to read format targets from a file. This allows users to specify more files that would be allowed by the OS line limit (such as during a pre-commit check).

Note: Files starting with '@' now require full path specification

format/private/format.sh Outdated Show resolved Hide resolved
Add support for '@file' syntax to read format targets from a file
Implement batch processing to handle large numbers of files
Maintain compatibility with direct command-line arguments

This change allows the format command to process an arbitrarily large
number of files by reading targets from a file, bypassing OS command
line length limits. It addresses issues with pre-commit hooks and other
tooling when formatting many files at once.
Note: This introduces a limitation where files starting with '@' cannot
be directly specified as format targets. Users must use the full file
path for such files.

Closes aspect-build#387
@mrmeku mrmeku marked this pull request as ready for review September 16, 2024 19:41
@mrmeku mrmeku merged commit 8f8a95b into aspect-build:main Sep 16, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR]: formatter: allow arguments spilled into a params file
2 participants