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
Precommit hook doesn't sort imports #39
Comments
👋 Hello! Thanks for submitting a issue! @Matt-Gleich will try to respond as soon as possible. |
@lig worked on this. Any idea on why this isn't working? |
I have some suspicions. I'll look into this.
It seems like it worked for me. @0b01001101 just to clarify: what pre-commit version do you use? Does replacing |
pre-commit 2.9.3 If i use dart-import-sorter i get this:
If I remove the |
@0b01001101 could you please run |
Still doesn't work for me It may have something to do with windows: https://stackoverflow.com/a/23384429 I will investigate the problem further tomorrow |
Could you please provide the full output? Please run it like this: |
|
@0b01001101 have you run Also, consider removing any |
This might be windows related indeed. However, |
It is strange: if I use For me the hotfix with sorting all files works more than good enough, I would say if nobody else has the same problem we close this issue for now. It may be a complex interaction between the flutter installation on a custom location, something related to windows or some other factors I can't even think of. |
I am also having issues on Windows. This is my output of
This is what I have in
|
41: fix: fix for the issue (#37) r=myConsciousness a=myConsciousness # 1. Description <!-- Provide a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change. If this is a breaking change, specify explicitly which APIs have been changed. --> The warning is fixed and now we can execute this pre-commit hook. However it's still have a bug related to [this](fluttercommunity/import_sorter#39). Since further improvement is difficult, the correction is now complete. ## 1.1. Checklist <!-- Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth and quick review process. --> - [x] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc). - [x] I have read the [Contributor Guide] and followed the process outlined for submitting PRs. - [x] I have updated/added tests for ALL new/updated/fixed functionality. - [x] I have updated/added relevant documentation in `docs` and added dartdoc comments with `///`. - [x] I have updated/added relevant examples in `examples`. ## 1.2. Breaking Change <!-- Does your PR require batch.dart users to manually update their apps to accommodate your change? If the PR is a breaking change this should be indicated with suffix "!" (for example, `feat!:`, `fix!:`). See [Conventional Commit] for details. --> - [ ] Yes, this is a breaking change. - [x] No, this is _not_ a breaking change. ## 1.3. Related Issues <!-- Provide a list of issues related to this PR from the [issue database]. Indicate which of these issues are resolved or fixed by this PR, i.e. Fixes #xxxx* !--> fluttercommunity/import_sorter#39 <!-- Links --> [issue database]: https://github.com/batch-dart/batch.dart/issues [contributor guide]: https://github.com/batch-dart/batch.dart/blob/main/CONTRIBUTING.md [batch.dart style guide]: https://github.com/batch-dart/batch.dart/blob/main/STYLEGUIDE.md [conventional commit]: https://conventionalcommits.org Co-authored-by: Kato Shinya <kato.shinya.dev@gmail.com>
Describe the bug
Precommit hook doesn't sort imports
To Reproduce
What command or actions did you take to produce this error?
Followed the steps at https://pub.dev/packages/import_sorter
When I run 'pre-commit run --all-files' nothing happens
.pre-commit-config.yaml:
I got it working with this hotfix as .pre-commit-config.yaml:
It may have something to do with the 'files: .dart$'
Meta Information:
import_sorter
Version: ^4.4.1The text was updated successfully, but these errors were encountered: