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

No configuration found when is used with git hook #28

Closed
wants to merge 2 commits into from
Closed

No configuration found when is used with git hook #28

wants to merge 2 commits into from

Conversation

sergio-alonso
Copy link
Contributor

@sergio-alonso sergio-alonso commented Mar 9, 2017

Files with changes are moved to a temporal directory when flake8 git hook is used.

$ flake8 --install-hook git

flake8-isort should look for configuration files in the current directory while checking the files in the temporary directory.

Before fix, no configuration is found.

$ git commit -m "Commit message"
script.py:0:1: I002 no configuration found (.isort.cfg or [isort] on setup.cfg)

After fix, project configuration is found.

$ git commit -m "Commit message"
script.py:1:1: D200 One-line docstring should fit on one line with quotes

… hook.

Files with changes are moved to a temporal directory when flake8 git hook is used.

$ flake8 --install-hook git

flake8-isort should look for configuration files in the current directory while checking the files in the temporary directory.

Before fix, no configuration is found.

$ git commit -m "Commit message"
[DEBUG] full_path = /tmp/tmpl7f83uys/home/user/src/project/script.py
script.py:0:1: I002 no configuration found (.isort.cfg or [isort] on setup.cfg)

After fix, project configuration is found.

$ git commit -m "Commit message"
[DEBUG] full_path = /home/user/src/project/script.py
script.py:1:1: D200 One-line docstring should fit on one line with quotes
@gforcada
Copy link
Owner

@sergio-alonso hi! thanks for the pull request! travis is failing due to a flake8 error, would you mind fixing it so that we can check if tests do pass after your changes? Thanks in advance!

@coveralls
Copy link

coveralls commented Mar 13, 2017

Coverage Status

Coverage decreased (-10.03%) to 81.633% when pulling a36bd7f on sergio-alonso:master into 2eb59ac on gforcada:master.

@gforcada
Copy link
Owner

@sergio-alonso thanks for fixing it!

Now that I check in more detail I did not know that flake8 had a way to integrate with git/mercurial, thanks for pointing that out!

Two last things:

@sergio-alonso
Copy link
Contributor Author

Hi @gforcada , I'm trying to figure out how to test it.

@gforcada
Copy link
Owner

@sergio-alonso any progress so far?

Looking at the code a bit more carefully I see that the code on search_isort_config_at_current method is the same the code in the loop on search_isort_config method. Would you mind if I take over your changes and extract that code into a method so code can be reused?

@gforcada
Copy link
Owner

I move it to #30 thanks for your work, I will try to release it during today or tomorrow.

@gforcada gforcada closed this Mar 25, 2017
@gforcada
Copy link
Owner

@sergio-alonso I made a new release (2.2) with your fix, would you mind giving it a try? thanks in advance.

@sergio-alonso
Copy link
Contributor Author

Thanks @gforcada I will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants