Skip to content

Commit

Permalink
py-autopep8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho committed Jun 24, 2024
1 parent 87807fe commit c24f5cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Supported Emacs Packages
- `python-isort <https://github.com/wyuenho/emacs-python-isort>`_
- `python-pytest <https://github.com/wbolster/emacs-python-pytest>`_
- `ruff-format <https://melpa.org/#/ruff-format>`_
- `py-autopep8 <https://github.com/emacsmirror/py-autopep8>`_


System Requirements
Expand Down
6 changes: 5 additions & 1 deletion pet.el
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ FN is `eglot--guess-contact', ARGS is the arguments to
(defvar ruff-format-command)
(defvar blacken-executable)
(defvar yapfify-executable)
(defvar py-autopep8-command)

(defun pet-buffer-local-vars-setup ()
"Setup the buffer local variables for Python tools.
Expand All @@ -951,6 +952,7 @@ buffer local values."
(setq-local ruff-format-command (pet-executable-find "ruff"))
(setq-local blacken-executable python-black-command)
(setq-local yapfify-executable (pet-executable-find "yapf"))
(setq-local py-autopep8-command (pet-executable-find "autopep8"))

(pet-eglot-setup))

Expand All @@ -976,6 +978,7 @@ buffer local values."
(kill-local-variable 'ruff-format-command)
(kill-local-variable 'blacken-executable)
(kill-local-variable 'yapfify-executable)
(kill-local-variable 'py-autopep8-command)

(pet-eglot-teardown))

Expand Down Expand Up @@ -1023,7 +1026,8 @@ has assigned to."
blacken-executable
python-isort-command
ruff-format-command
yapfify-executable))))
yapfify-executable
py-autopep8-command))))

(with-current-buffer-window "*pet info*" nil nil
(mapc (pcase-lambda (`(,key . ,value))
Expand Down

0 comments on commit c24f5cf

Please sign in to comment.