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

spaces vs tabs #207

Closed
fAntel opened this issue May 20, 2015 · 4 comments
Closed

spaces vs tabs #207

fAntel opened this issue May 20, 2015 · 4 comments

Comments

@fAntel
Copy link

fAntel commented May 20, 2015

Can I somehow tell autopep8 do not swap tabs with spaces. In pep8 I can use --ignore=W191. But even with --ignore=W191 autopep8 always swaps tabs with spaces.

@myint
Copy link
Collaborator

myint commented May 20, 2015

Try --ignore=W191,E101,E111.

@fAntel
Copy link
Author

fAntel commented May 23, 2015

Thank you. With this options autopep8 swap spaces only in multiline lists and it easy to fix.

@jaraco
Copy link

jaraco commented Nov 12, 2017

This issue persists, as it's still converting tabs to spaces in multiline lists as reported above.

$ git diff 
diff --git a/docs/conf.py b/docs/conf.py
index 8bc8298..f85a3be 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -10,23 +10,23 @@ extensions = [
 master_doc = 'index'
 
 link_files = {
-       '../CHANGES.rst': dict(
-               using=dict(
-                       GH='https://github.com',
-               ),
-               replace=[
-                       dict(
-                               pattern=r'(Issue )?#(?P<issue>\d+)',
-                               url='{package_url}/issues/{issue}',
-                       ),
-                       dict(
-                               pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
-                               with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
-                       ),
-                       dict(
-                               pattern=r'PEP[- ](?P<pep_number>\d+)',
-                               url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
-                       ),
-               ],
-       ),
+    '../CHANGES.rst': dict(
+        using=dict(
+            GH='https://github.com',
+        ),
+        replace=[
+            dict(
+                pattern=r'(Issue )?#(?P<issue>\d+)',
+                url='{package_url}/issues/{issue}',
+            ),
+            dict(
+                pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
+                with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
+            ),
+            dict(
+                pattern=r'PEP[- ](?P<pep_number>\d+)',
+                url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
+            ),
+        ],
+    ),
 }

Although for fAntel, that was easy to fix, it's obnoxious on code bases that have more than a few multiline lists.

autopep8 should honor an option not to convert tabs to spaces.

@dbogatov
Copy link

dbogatov commented Feb 6, 2018

Could we reopen the issue?
We need to have option to use tabs natively - not in a hacky way, like disabling errors.

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

No branches or pull requests

4 participants