summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--MANIFEST.in28
-rw-r--r--TODO46
-rw-r--r--checkers/utils.py2
-rw-r--r--debian/changelog2
-rw-r--r--elisp/pylint-flymake.el5
-rw-r--r--elisp/pylint.el58
-rw-r--r--lint.py13
-rw-r--r--test/input/w0401_cycle.py2
-rw-r--r--test/runtests.py5
10 files changed, 53 insertions, 109 deletions
diff --git a/ChangeLog b/ChangeLog
index df6117f1f..ae4d74f13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@ ChangeLog for PyLint
* don't show information messages by default
+ * integration of Yuen Ho Wong's patches on emacs lisp files
2009-03-19 -- 0.17.0
diff --git a/MANIFEST.in b/MANIFEST.in
index 0a1ba42c3..2fcee65dc 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,23 +1,11 @@
+include ChangeLog
include COPYING
include DEPENDS
-include ChangeLog
-include TODO
-include bin/symilar
-include bin/pylint
-include bin/pylint-gui
-include bin/epylint
-include bin/pyreverse
-include bin/*.bat
-include examples/pylintrc*
-include examples/*.py
-include elisp/*.el
-include elisp/startup
-include man/pylint.1
-include man/pyreverse.1
-include test/data/packages_No_Name.dot
-include test/data/classes_No_Name.dot
+include bin/*
+include examples/*
+include elisp/*
+include man/*
recursive-include doc *.txt *.html
-recursive-include test/input *.py similar* noext
-recursive-include test/messages *.txt *.txt2
-recursive-include test/regrtest_data *.py
-include test/fulltest.sh
+recursive-include test *.py *.txt *.txt2 *.dot *.sh
+include test/input/similar* noext
+include test/input/noext
diff --git a/TODO b/TODO
deleted file mode 100644
index aaf847298..000000000
--- a/TODO
+++ /dev/null
@@ -1,46 +0,0 @@
-PyLint's TODO list
-------------------
-
-
-- un rapport avec les métriques vues dans TDD
-- métrique manquantes
-- tests
-
-* faire tourner sur wxpython...
-
-* test external dependancies
-
-
-* avoir les options liés à un message id dans son aide
-
-* avoir les messages id géré par un checker dans --help
-
-* avoir la valeur courante des options dans --help
-
-* doc développeur
-
-* supporter des wildcards dans disable-msg ?
-
-* voir notes gvr sur main
-
-* récupérer les phrases d'évaluation dans un fichier texte
-
-* i18n avec gettext
-
-* commenter les regexp de format.py
-
-* gestion nested_scopes (modes py2.1, 2.2... ?)
-
-* checkers :
- - vérifier arguments __new__
- - compléter format checker
- voir http://www.python.org/peps/pep-0008.html
- - vérifier classes sans __init__ mais avec plusieurs ancêtres ayant
- un __init__
- - opérateur % avec des formats ne correspondant pas aux arguments
- - mauvais nombre d'arguments passés à une méthode ou fonction
- - utilisation constante dans condition
- - gestion del statements
- - vérification utilisation __getattribute__, __slots__ dans new
- style class seulement
- - vérification assignements quand __slots__
diff --git a/checkers/utils.py b/checkers/utils.py
index 362c2f603..ba371a53f 100644
--- a/checkers/utils.py
+++ b/checkers/utils.py
@@ -193,7 +193,7 @@ def display_type(node):
PYMETHODS = set(('__new__', '__init__', '__del__', '__hash__',
'__str__', '__repr__',
'__len__', '__iter__',
- '__get__', '__set__',
+ '__delete__', '__get__', '__set__',
'__getitem__', '__setitem__', '__delitem__', '__contains__',
'__getattribute__', '__getattr__', '__setattr__', '__delattr__',
'__call__',
diff --git a/debian/changelog b/debian/changelog
index 9a2605b88..9401d4a3f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -240,7 +240,7 @@ pylint (0.9.0-1) unstable; urgency=low
pylint (0.8.1-1) unstable; urgency=low
- * added missing dependancy to logilab-astng
+ * added missing dependency to logilab-astng
* added missing .docs and .examples files
* update control'standards-version to 3.6.2
* fixed FSF address in the copyright file
diff --git a/elisp/pylint-flymake.el b/elisp/pylint-flymake.el
index df4686711..6313ba545 100644
--- a/elisp/pylint-flymake.el
+++ b/elisp/pylint-flymake.el
@@ -1,6 +1,4 @@
-
;; Configure flymake for python
-(setq pylint "epylint")
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
@@ -8,7 +6,8 @@
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
- (list (expand-file-name pylint "") (list local-file))))
+ (list "epylint" (list local-file))))
+
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))
diff --git a/elisp/pylint.el b/elisp/pylint.el
index a9b22b174..01d15f125 100644
--- a/elisp/pylint.el
+++ b/elisp/pylint.el
@@ -1,3 +1,5 @@
+;; Fixed bug where py-mode-map is undefined in Gnu Emacs 22 and 23
+;; Yuen Ho Wong (2009)
;;
;; Modifications done by Yarosav O. Halchenko (2008):
;; - enable user-visible variables
@@ -25,34 +27,38 @@
(defun pylint ()
"Run pylint against the file behind the current buffer after
checking if unsaved buffers should be saved."
-
+
(interactive)
(let* ((file (buffer-file-name (current-buffer)))
- (command (concat "pylint " pylint-options " \"" file "\"")))
+ (command (concat "pylint " pylint-options " \"" file "\"")))
(save-some-buffers (not compilation-ask-about-save) nil) ; save files.
- (compile-internal command "No more errors or warnings" "pylint")))
-;; (local-set-key [f1] 'pylint)
-;; (local-set-key [f2] 'previous-error)
-;; (local-set-key [f3] 'next-error)
-
- (define-key
- py-mode-map
- [menu-bar Python pylint-separator]
- '("--" . pylint-seperator))
-
- (define-key
- py-mode-map
- [menu-bar Python next-error]
- '("Next error" . next-error))
- (define-key
- py-mode-map
- [menu-bar Python prev-error]
- '("Previous error" . previous-error))
- (define-key
- py-mode-map
- [menu-bar Python lint]
- '("Pylint" . pylint))
-
- )
+ (compilation-start command)))
+
+ (let ((python-mode-map (cond ((boundp 'py-mode-map) py-mode-map)
+ ((boundp 'python-mode-map) python-mode-map))))
+
+ ;; shortcuts in the tradition of python-mode and ropemacs
+ (define-key python-mode-map (kbd "C-c m l") 'pylint)
+ (define-key python-mode-map (kbd "C-c m p") 'previous-error)
+ (define-key python-mode-map (kbd "C-c m n") 'next-error)
+
+ (define-key
+ python-mode-map
+ [menu-bar Python pylint-separator]
+ '("--" . pylint-seperator))
+
+ (define-key
+ python-mode-map
+ [menu-bar Python next-error]
+ '("Next error" . next-error))
+ (define-key
+ python-mode-map
+ [menu-bar Python prev-error]
+ '("Previous error" . previous-error))
+ (define-key
+ python-mode-map
+ [menu-bar Python lint]
+ '("Pylint" . pylint))
+ ))
(add-hook 'python-mode-hook 'pylint-python-hook)
diff --git a/lint.py b/lint.py
index b7e5f2adf..8c7ef1908 100644
--- a/lint.py
+++ b/lint.py
@@ -35,7 +35,8 @@ import os
import re
import tokenize
-from logilab.common.configuration import UnsupportedAction, OptionsManagerMixIn, check_csv
+from logilab.common.configuration import UnsupportedAction, OptionsManagerMixIn
+from logilab.common.optik_ext import check_csv
from logilab.common.modutils import load_module_from_name
from logilab.common.interface import implements
from logilab.common.textutils import splitstrip
@@ -837,11 +838,11 @@ processing.
linter.add_help_section('Output status code', '''
Pylint should leave with following status code:
* 0 if everything went fine
- * 1 if some fatal message issued
- * 2 if some error message issued
- * 4 if some warning message issued
- * 8 if some refactor message issued
- * 16 if some convention message issued
+ * 1 if a fatal message was issued
+ * 2 if an error message was issued
+ * 4 if a warning message was issued
+ * 8 if a refactor message was issued
+ * 16 if a convention message was issued
* 32 on usage error
status 1 to 16 will be bit-ORed so you can know which different categories has
diff --git a/test/input/w0401_cycle.py b/test/input/w0401_cycle.py
index 1fbf88060..4c03cae0c 100644
--- a/test/input/w0401_cycle.py
+++ b/test/input/w0401_cycle.py
@@ -1,4 +1,4 @@
-"""w0401 dependancy
+"""w0401 dependency
"""
__revision__ = 0
diff --git a/test/runtests.py b/test/runtests.py
deleted file mode 100644
index 67d66367b..000000000
--- a/test/runtests.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from logilab.common.testlib import main
-
-if __name__ == '__main__':
- import sys, os
- main(os.path.dirname(sys.argv[0]) or '.')