lyz-code / autoimport

Autoimport automatically fixes wrong import statements.
https://lyz-code.github.io/autoimport
GNU General Public License v3.0
97 stars 24 forks source link

feat: `~/.config/autoimport/config.toml` support, `affect_indented_imports` configuration #172

Closed HoverHell closed 2 years ago

HoverHell commented 2 years ago

Prior discussion: https://github.com/lyz-code/autoimport/issues/169#issuecomment-989100892

I opted to merge two configs instead of looking for them in order.

As always, if there are no objections to the general changes, I'll add tests and docs.

Checklist

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 1559663820


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/autoimport/services.py 19 21 90.48%
<!-- Total: 25 27 92.59% -->
Totals Coverage Status
Change from base Build 1555497773: -0.3%
Covered Lines: 272
Relevant Lines: 286

💛 - Coveralls
HoverHell commented 2 years ago

In what case would you be interested in not changing the indented imports?

Right now autoimport moves the function-level imports to the module-level, which is not what I need.

What was the initial intention of such behaviour?

Jasha10 commented 2 years ago

@HoverHell are you still interested in working on this? There have been two updates to maison since this PR was opened:

If this PR is no longer on your radar, just say the word so that someone else can take over the diff :)

HoverHell commented 2 years ago

If this PR is no longer on your radar, just say the word so that someone else can take over the diff :)

I'm using these changes locally, and not sure if I will have the time to do further work towards merging within the next month.

Message ID: @.***>

lyz-code commented 2 years ago

Thanks for the answer @HoverHell. The PR is open then for anyone that wants to adopt it and implement the changes suggested above.

If you want to finish it yourself, please say so in the comments to avoid duplication of work.

Thanks! :)

lyz-code commented 2 years ago

Closing the PR as it's been implemented by @Jasha10 on https://github.com/lyz-code/autoimport/pull/206

Thank you for opening the path @HoverHell