Giter Site home page Giter Site logo

py-autopep8.el's Issues

setup.cfg ignored

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).

Would like to disable the hook on a per buffer basis

When editing other people's code, I would like to disable the hook on a per buffer basis so I don't change their whitespace or other aspects of their code.

Are you open to a change like this in py-autopep8.el?

;;;###autoload
(defun py-autopep8-enable-on-save ()
  "Pre-save hook to be used before running autopep8."
  (interactive)
  (if current-prefix-arg
      (progn
        (remove-hook 'before-save-hook 'py-autopep8-buffer t)
        (message "py-autopep8-buffer removed"))
    (add-hook 'before-save-hook 'py-autopep8-buffer nil t)))

I can create a pull request if so, otherwise, I am open to your preferences...

Thanks

hanging autopep8.py hangs emacs

I know this is not py-autopep8 issue, but it is really annoying. Imagine you have a file (f.e one w/ huge dict definition) which effectively kills autopep8 (or make it really busy for couple minutes). While this is happening, the whole is editor is frozen and can't be worked with. Could this issue be solved async processing?

It's super annoying especially when you have autopep8 on save hook on.

go--apply-rcs-patch is void

when I run python-fmt, I get errors:

Wrote /tmp/autopep825173kvD.py
if: Symbol's function definition is void: go--apply-rcs-patch

and what should I do?

Is this repository still active ?

Hi,

So first of all, thanks for this useful package.
I forked this repo and started making some changes.
Namely I refactored so that it is a minor-mode than can be enabled/disabled on a per-buffer basis.
I'd like to know if you think I should drop the PR here or if I should push my own package to MELPA ?
But there does not seem to have many activity around here...

Cheers

Error in emacs 24

There is an error when I try to execute py-autopep8-before-save on Python mode buffer:

Invalid function: decf

Emacs version is: GNU Emacs 24.3.1
And py-autopep8 version is: 20140528.1138
What information could I provide to help resolve this?

avoiding ^M when using py-autopep8 on Windows

Using py-autopep8 on Windows:

test.py (saved with DOS-style EOL, but same results when saving as UNIX EOL)



import os, os.path

Becomes the following after M-x py-autopep8:

^M
^M
import os^M
import os.path^M

Is there a way to avoid the extra ^M being added? When running autopep8 from cmdline I don't get the extra characters. Thanks

Inability to add agressiveness levels higher than 1

No matter what I try setting the py-autopep8-options variable to, I either get 1 of 2 outcomes. Either I do something along the lines of (setq py-autopep8-options '("-a")) and get an aggresssiveness level lower than I want or do something along the lines of (setq py-autopep8-options '("-a -a)) and get an error. Is this an issue with my understanding of the py-autopep8-options variable?

Code loss with autopep8!

I installed autopep8 two weeks ago and I'm plagued by autopep8 removing valid code from my scripts. I use docopt and nipype, which have unique syntax but I'm stumped. Here's an example of code that is auto-removed:

#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Usage:
  preprocessing.py [-h | --help]
  preprocessing.py [-f | --force] [-g | -b] [-F FORMAT | --format=FORMAT] (-n NAME| --name=NAME) SESSION...

Arguments:
  -n NAME, --name=NAME        experiment name
  SESSION                     one or more session IDs

Optional:
  -h, --help                  show this help message and exit
  -f, --force                 force DataSink rewriting
  -g                          global signal regression by masking gray matter
  -b                          whole brain
  -F FORMAT, --format=FORMAT  output format, values: afni, nifti, nifti_gz [default: nifti]

Example:
  preprocessing.py -n my_new_experiment 0001 0002 0003
  preprocessing.py -fgF nifti_gz --name new_experiment_w_gray_mask 00001 00002 00003
  preprocessing.py -bn my_new_experiment_brain_mask --format afni 0001 0002 0003
"""
# TODO: Modify virtualenv to include formatFMRI.sh
import os
import sys

import SEMTools as sem
from nipype.interfaces.ants.registration import Registration
from nipype.interfaces.ants import ApplyTransforms
from nipype.interfaces.afni.preprocess import *
from nipype.interfaces.freesurfer.preprocess import *
from nipype.interfaces.io import DataSink, DataGrabber
from nipype.interfaces.utility import Function, IdentityInterface, Rename, Select
from nipype.interfaces.utility import Merge as Merger
import nipype.pipeline.engine as pipe
import numpy

from utilities import *
...

Removing the #emacs ... and #vi:... lines stops this behavior, but I can't reproduce it now. It appears randomly!?! >:(

autopep8 command not found

It's work well at emacs24.4 (GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0))
but
when I use Emacs of Mac OS X(This is GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21),with GUI, display "autopep8 command not found" on the mini buffer.
also,
I use this M-x py-autopep8-buffer to call the function.
thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.