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

Allow to format only specific files #17

Closed
zaalbarxx opened this issue Jun 23, 2022 · 7 comments
Closed

Allow to format only specific files #17

zaalbarxx opened this issue Jun 23, 2022 · 7 comments

Comments

@zaalbarxx
Copy link

I believe it is an important feature to allow for passing list of files which should be formatted upon run instead of formatting all files. This is usable in case formatting is happening on pre-commit hook (for example in our case we have lint-staged configured which is formatting staged PHP files before commit). I don't see this anywhere as a documented feature and the command input arguments also does not seem to allow for this.

@d8vjork
Copy link

d8vjork commented Jun 23, 2022

Yes! Any chance to get this done? I can help with this on a PR if you guys want.

I need this for a VSCode extension I'm working on

@jbrooksuk
Copy link
Member

jbrooksuk commented Jun 23, 2022

You can now fix a single file with pint file.php in the latest version of Pint.

@zaalbarxx
Copy link
Author

zaalbarxx commented Jun 23, 2022

Does it allow to pass multiple files like pint file1.php file2.php file3.php ? This is how CS-Fixer works. When commiting changes the resulting command for linting will be like pint staged-file-1.php staged-file-2.php etc. @jbrooksuk @nunomaduro

@jbrooksuk
Copy link
Member

No, only one file at a time.

Ping @nunomaduro.

@zaalbarxx
Copy link
Author

@nunomaduro :) could we re-implement this to allow for multiple files ? I think it should be pretty straightforward.

@brandonburkett
Copy link

I would also really like this feature, using with lint-staged specifically.

@jbrooksuk
Copy link
Member

You can do this now.

ablancobarreda added a commit to ablancobarreda/pint that referenced this issue Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants