-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add argument to sort some files only? #27
Comments
👋 Hello! Thanks for submitting a issue 😄! @Matt-Gleich Will try to respond as soon as possible. |
You can configure what files to sort right now using the config. Does this not work for you? https://github.com/fluttercommunity/import_sorter#%EF%B8%8F-config |
But how to select files with command arguments?
|
Is there a reason you don't want them all sorted in this case? |
Yes, I have hundreds of files in my repository and it makes the process a little bit slower; also there are a lot of unnecessary (and unwanted) outputs. I want all files to be sorted, but only once. Then for every commits I made to my repository, the unchanged files doesn't need to be sorted, right? |
Ahh, I see. This is a good idea! I will look into it and see how easy it would be to do something like this. Any updates I make will be posted in this issue thread. |
@Matt-Gleich basically, it will be great to have this usable with IDEs/editors meaning sorting in a particular file and in a pre-commit hook, ideally, integrated in the pre-commit tool via pre-commit-config.yaml. |
@lig do you think something like this would work well? --files=bin/main.dart,lib/hello.dart |
I think just positional arguments would be better to integrate with other tools like |
So something like this @davidlj95? flutter pub run import_sorter:main bin/main.dart lib/hello.dart |
Yes!! ✨ |
This is now in v4.3.0 of import_sorter! You can supply a list of files or a list of regular expressions to only sort certain files! Check the command line section in the docs for more information. |
Thanks!! 🌟 |
Hi, I would like to use this together with my git hook, and have my changed files sorted only.
It would be great to having a way to sort only a subset of files, instead of sorting all of them.
The text was updated successfully, but these errors were encountered: