Skip to content

Instantly share code, notes, and snippets.

@machinekoder
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machinekoder/44e77b43d67d1d0db180 to your computer and use it in GitHub Desktop.
Save machinekoder/44e77b43d67d1d0db180 to your computer and use it in GitHub Desktop.
pycheckers for Emacs
;; Setup flymake for Python
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "pycheckers" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))
(add-hook 'python-mode-hook
(lambda ()
(unless (eq buffer-file-name nil) (flymake-mode 1)) ;dont invoke flymake on temporary buffers for the interpreter
(local-set-key [f2] 'flymake-goto-prev-error)
(local-set-key [f3] 'flymake-goto-next-error)
))
;; Show flymake cursor
(load "flymake-cursor")
;; run flymake in place to work with tramp
(setq flymake-run-in-place nil)
;; Spaces instead of tabs
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)
(setq tab-stop-list (number-sequence 4 200 4))
(setq c-default-style "linux"
c-basic-offset 4)
;; Show matching parenthesis
(show-paren-mode 1)
;; Show tabs
(require 'whitespace)
(setq whitespace-style (quote (face trailing tabs tab space-before-tab::space space-after-tab::space indentation::space)))
(global-whitespace-mode t)
#!/bin/bash
epylint "$1" 2>/dev/null
pyflakes "$1"
pep8 --ignore=E128,E265,W293,W291,E501 --repeat "$1"
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment