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

Feature Request: pattern specific config overrides #26

Open
I-Enderlord-I opened this issue May 26, 2023 · 0 comments · May be fixed by #27
Open

Feature Request: pattern specific config overrides #26

I-Enderlord-I opened this issue May 26, 2023 · 0 comments · May be fixed by #27
Labels
duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed

Comments

@I-Enderlord-I
Copy link

I-Enderlord-I commented May 26, 2023

In some of my projects there are special files (recognisable by their names) that always import certain base classes. I'd like to always have those base classes at the top as a kind of header, but split them into other groups in regular files.

I'd be helpful if one could create multiple group configurations, which are selected based on a regex matching the file path. Possibly by adding an option overrides: { pattern: string, config: string }[] which specifies alternative config files for special patterns.

Since the files in question do not lie in separate folders and the imported functions appear elsewhere as well, it's not possible to use specialized config files in subfolders or more complicated grouping rules. Since I use the VSCode plugin for this, this machanic could be achieved by vscode issue 35350, but that might take some time. The only option right now is to exclude those files and do the sorting manually, but that defeats the purpose of using format-imports.

Basically a duplicate of issue 75 in the plugin repository, but now at the place where config resolution actually happens.

@daidodo daidodo added duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants