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

setup.cfg ignored #24

Open
henniss opened this issue Aug 8, 2017 · 4 comments · Fixed by melpa/melpa#7999
Open

setup.cfg ignored #24

henniss opened this issue Aug 8, 2017 · 4 comments · Fixed by melpa/melpa#7999

Comments

@henniss
Copy link

henniss commented Aug 8, 2017

I'd like to be able to disable autopep8 by default, and enable on a per-repository basis.

I have the following:

~/.config/pep8:

[pep8]
select=None

$PROJECT/setup.cfg

[pep8]
select=

When I run autopep8 $PROJECT/bad.py, this behaves as I expect, and bad.py is printed with errors corrected. Furthermore, if I remove setup.cfg, autopep8 will respect the user config and will no longer correct errors.

However, if I open up bad.py with emacs, py-autopep8 reports the buffer as already pep8ified, as if setup.cfg wasn't there. (py-autopep8 works fine if I edit the user config, but that's not the behavior I want).

@bsima
Copy link

bsima commented Aug 11, 2017

I too am having this issue. It causes conflicts with project-specific pep8 settings, which is inhibitory in some use-cases where you want to enforce formatting settings across all dev environments. I'm going with a git precommit hook for now instead of an emacs plugin.

@piojanu
Copy link

piojanu commented Mar 27, 2019

The same here, I had to disable py-autopep8 :/ Any work around for this issue?

@ideasman42
Copy link

ideasman42 commented Apr 24, 2022

This happened because the temporary file caused the local configuration not to be detected.

Resolved in my repo which used stdin/stdout pipes to format, changing the working directory to that of the file causes the configuration to be loaded properly in my tests https://github.com/ideasman42/emacs-py-autopep8/commit/171a69198e7a379622b84a51239f3e621219f9a0

@ideasman42
Copy link

ideasman42 commented May 3, 2022

Melpa now points to a fork of this package maintained here: https://github.com/ideasman42/emacs-py-autopep8

Detecting local configuration is supported, although I've only added support for pyproject.toml which seems to be the recommended configuration these days. Writing checks for other kinds of files is trivial.

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 a pull request may close this issue.

4 participants