markbaas / atom-python-autopep8 Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
e.g. (-a)
there's an array in the code dedicated for these but the option doesn't appear in the settings after installation. (forgotten maybe?)
Hello.
May I suggest the line:
return editor.getGrammar().name.indexOf("Python",0) > 0
instead of..
https://github.com/markbaas/atom-python-autopep8/blob/master/lib/python-autopep8.coffee#L11
grammar = editor.getGrammar().name
return grammar == 'Python' or grammar == 'MagicPython'
My aim is to provide for more Python derivatives.
(I added the line on an older version to adapt to MagicPython
).
Thank you for your consideration.
It converts this:
x = x*2 - 1
hypot2 = x*x + y*y
c = (a+b) * (a-b)
to this
x = x * 2 - 1
hypot2 = x * x + y * y
c = (a + b) * (a - b)
which is marked to not to do this in PEP8.
Source
EDIT:
Sorry was supposed to be in autopep8 issue tracker
I'm using the "Django-atom" package and I have to switch to "source.python" grammar to use atom-python-autopep8
package.
Any fix suggestion?
Atom completely crashes whenever I try to save a file when "Format on Save" box is checked in the autopep8 Settings menu.
Could you help with this issue:
AtomLinter/linter-flake8#64 (comment)
Problem is that the linter-flake8 checks just before autopep8 changes the buffer, so I always have to save twice like this to avoid having errors that autopep8 already did repair.
Somehow, autopep8 should be running before the linter get's active, and the author of linter-flake8 recommend the setting modifiesBuffer:true
for your plugin? But apparently, this is only supported by linter-plugins? Not sure about that, would be great if this could work together better.
I don't se an option where you can chose if you only want to pep8 .py files.
I had an issue using Kivy, where I needed to create a .kv file. One line needed explicitly to be:
<AppGame>:
When I save it, the pep8 script will modify it to:
<AppGame >:
This format won't work with Kivy. It need to explicitly be without space. So I don't want to run the script on .kv files.
The package doesn't put spaces before and after the arithemetic operators + - * /
.
There was a commit from 2016 that makes autopep8 aware of MagicPython, but the latest version from installing with apm gets us an older version from 2015 (0.1.3).
OS Windows 10
This seems to be a common problem currently in Atom, apparently some API has changed inside Atom that prevents this from working?
I currently have to provide the full path in the settings, as for flake8 and isort, those packages suffer from the same problem. I don't know if this should be solved on Atom level or on package level.
I would prefer the flexibility to have it set by the PATH environment because that way the currently active virtual environment decides which executable is being used for this. Even so maybe for pep8 there are no differences between Python2 and Python3?
@markbaas
Thanks for a very useful plugin!
However, it seems there hasn't been any update in a few years, and the latest commits from 2016 are not even available on apm
โฆ
If you are no longer interested in maintaining it, perhaps you would consider handing the repo over to someone, so that the apm version can at least be updated?
Cheers!
Atom: 1.12
OS: macOS 10.11.6
Python: 3.5 inside conda env
I use conda so to make sure autopep8
is found, I put the absolute path to the executable into the settings.
I tried it both with the "Format on Save" option and the manual call via the menu, to no avail.
I have several PEP8 issues, like E225 (missing whitespace after operator).
When using autopep8
inside the Terminal these issues are being found and corrected.
How can I help to debug this?
I have installed autopep8 but it is not working.
[Enter steps to reproduce:]
Atom: 1.19.0 x64
Electron: 1.6.9
OS: Unknown Windows version
Thrown From: python-autopep8 package 0.1.4
Failed to load the python-autopep8 package
At Cannot find module 'jquery'
Error: Cannot find module 'jquery'
at Module._resolveFilename (module.js:470:15)
at Module._resolveFilename (~/AppData/Local/atom/app-1.19.0/resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.get_Module._resolveFilename (~/AppData/Local/atom/app-1.19.0/resources/app/src/module-cache.js:354:58)
at Module.require (~/AppData/Local/atom/app-1.19.0/resources/app/static/index.js:40:43)
at require (~/AppData/Local/atom/app-1.19.0/resources/app/src/native-compile-cache.js:66:33)
at /packages/atom-python-autopep8/lib/python-autopep8.coffee:1:5)
at /packages/atom-python-autopep8/lib/python-autopep8.coffee:1:1)
at /packages/atom-python-autopep8/lib/python-autopep8.coffee:1:1)
at Module.get_Module._compile (~/AppData/Local/atom/app-1.19.0/resources/app/src/native-compile-cache.js:106:36)
at Object.value [as .coffee] (~/AppData/Local/atom/app-1.19.0/resources/app/src/compile-cache.js:239:29)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (~/AppData/Local/atom/app-1.19.0/resources/app/static/index.js:47:45)
at require (~/AppData/Local/atom/app-1.19.0/resources/app/src/native-compile-cache.js:66:33)
at /packages/atom-python-autopep8/lib/index.coffee:1:18)
at /packages/atom-python-autopep8/lib/index.coffee:1:1)
at /packages/atom-python-autopep8/lib/index.coffee:1:1)
at Module.get_Module._compile (~/AppData/Local/atom/app-1.19.0/resources/app/src/native-compile-cache.js:106:36)
at Object.value [as .coffee] (~/AppData/Local/atom/app-1.19.0/resources/app/src/compile-cache.js:239:29)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (~/AppData/Local/atom/app-1.19.0/resources/app/static/index.js:47:45)
at require (internal/module.js:20:19)
at customRequire (~/AppData/Local/atom/app-1.19.0/resources/app/static/<embedded>:96:26)
at Package.module.exports.Package.requireMainModule (~/AppData/Local/atom/app-1.19.0/resources/app/src/package.js:887:35)
at ~/AppData/Local/atom/app-1.19.0/resources/app/src/package.js:158:34
at Package.module.exports.Package.measure (~/AppData/Local/atom/app-1.19.0/resources/app/src/package.js:99:21)
at Package.module.exports.Package.load (~/AppData/Local/atom/app-1.19.0/resources/app/src/package.js:144:18)
-0:36.8.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always)
atom-beautify 0.30.4
python-autopep8 0.1.4
atom-python-package 0.7.1
atom-python-run 0.8.1
atom-terminal-panel 4.4.4
atom-ternjs 0.18.3
atom-typescript 11.0.6
autocomplete-python 1.10.0
darkpython-syntax 0.5.0
emmet 2.4.3
file-icons 2.1.10
highlight-selected 0.13.1
Hydrogen 1.19.0
hyperclick 0.1.3
js-hyperclick 1.11.0
linter 2.2.0
linter-flake8 2.2.1
linter-pylama 0.9.3
linter-pylint 2.1.0
linter-python 3.1.2
linter-python-pep8 0.2.0
monokai 0.24.0
nom undefined
npm undefined
project-manager 3.3.5
python-debugger 0.2.0
python-indent 1.1.0
python-tools 0.6.9
quick-highlight 0.10.0
Remote-FTP 1.1.3
remote-sync 4.1.5
script 3.15.0
seti-ui 1.9.0
simplified-chinese-menu 5.3.4
tortoise-svn 0.5.1
I installed python-autopep8, but when I execute ctrl+s or ctrl+alt+s to correct pep8 it close Atom.
When I reopen my file it was correct, but always I use keyboard shortcut Atom close.
OS: Windows 10 64x
Atom: 1.18.0 64x
[Linter] Error running pyflakes Error: Failed to spawn command pyflakes
. Make sure pyflakes
is installed and on your PATH
at /home/rasha/.atom/packages/linter-pyflakes/node_modules/atom-linter/lib/helpers.js:130:24
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Could not fetch URL https://pypi.python.org/simple/autopep8/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661) - skipping
Could not find a version that satisfies the requirement autopep8 (from versions: )
No matching distribution found for autopep8.
any solution for this? thankyou!
Hey I guys, I'm really hoping someone can help me out. I've been trying to figure this out for 2 days now and I've felt like punching my computer... so frustrated. It's certainly my fault but I don't know enough about it to troubleshoot.
I'm trying to use autopep8 in Atom on mac. I've installed autopep8 using sudo pip3 install autopep8
but the install path seems to be wrong. It's currently installed at /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
which I think is wrong. I know how to uninstall but I don't know how to choose the install location, nor do I know where it's supposed to be installed. I've tried pointing Atom to this directory under the settings for the autopep8 plugin but it has not worked. I've uninstalled and reinstalled more times than i can count, I've tried moving the files to a different directory, I've gone through all of the troubleshooting stuff I can find. I just have no idea what I'm supposed to do. I can provide any information needed to fix this problem, I just don't know what's needed. Please just let me know what I need to attach and I will get it. Thank you to anybody who can help me.
Like the much-hated and useless E129. I would love something similar to what's provided in atom-pep8, as an ability to ignore specific PEP8 errors.
[Enter steps to reproduce:]
Atom: 1.58.0 x64
Electron: 9.4.4
OS: Microsoft Windows 10 Home
Thrown From: python-autopep8 package 0.1.3
Failed to activate the python-autopep8 package
At Cannot find module 'C:\Users\user-PC\.atom\packages\python-autopep8\node_modules\jquery\dist\jquery.js'. Please verify that the package.json has a valid "main" entry
Error: Cannot find module 'C:\Users\user-PC\.atom\packages\python-autopep8\node_modules\jquery\dist\jquery.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:301:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:532:18)
at Module._resolveFilename (internal/modules/cjs/loader.js:784:27)
at o._resolveFilename (electron/js2c/renderer_init.js:43:689)
at Function.get_Module._resolveFilename (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:157920)
at Module.require (/app.asar/static/index.js:61:43)
at require (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:149207)
at /packages/python-autopep8/lib/python-autopep8.coffee:1:5)
at /packages/python-autopep8/lib/python-autopep8.coffee:1:1)
at /packages/python-autopep8/lib/python-autopep8.coffee:1:1)
at Module.get_Module._compile (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:149891)
at Object.value [as .coffee] (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:153485)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module._load (electron/js2c/asar.js:769:28)
at Module.require (/app.asar/static/index.js:72:46)
at require (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:149207)
at /packages/python-autopep8/lib/index.coffee:1:18)
at /packages/python-autopep8/lib/index.coffee:1:1)
at /packages/python-autopep8/lib/index.coffee:1:1)
at Module.get_Module._compile (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:149891)
at Object.value [as .coffee] (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:153485)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module._load (electron/js2c/asar.js:769:28)
at Module.require (/app.asar/static/index.js:72:46)
at require (internal/modules/cjs/helpers.js:74:18)
at customRequire (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:1:802772)
at requireModule (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:14:1195622)
at Package.requireMainModule (~/AppData/Local/atom/app-1.58.0/resources/app/static/<embedded>:11:3520513)
4x -4:48 core:move-left (input.hidden-input)
2x -4:46.9.0 core:backspace (input.hidden-input)
-1:04.8.0 core:paste (div.placeholder-text)
-0:28.1.0 core:backspace (input.hidden-input)
autocomplete-python 1.17.0
busy-signal 2.0.1
file-icons 2.1.47
intentions 2.1.1
linter 3.4.0
linter-flake8 2.4.0
linter-ui-default 3.4.1
predawn-syntax 1.0.4
python-autopep8 0.1.3
script 3.32.2
I have a problem that I need to import some modules not at the beginning of the module.
The autopep8 is always rearranging them to the top which is not correct.
I thought that it should not do the correction in this cases or there should be an option to disable this correction.
Thanks a lot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.