Project

General

Profile

Revision 7b81cb66

ID7b81cb6627334865a5757cdc5a2ca7fe2196f2ac
Parent acb87a14
Child c541cd24

Added by Aurelien BOMPARD almost 15 years ago

Nettoyages divers

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@320 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

Makefile
1
NAME = 
1
NAME = vigiboard
2 2

  
3 3
all: bin/python
4 4
	@echo "Template Makefile, to be filled with build and install targets"
......
17 17
	rm -rf eggs develop-eggs parts .installed.cfg bin
18 18

  
19 19
apidoc: doc/apidoc/index.html
20
doc/apidoc/index.html: src/vigilo
20
doc/apidoc/index.html: $(NAME)
21 21
	rm -rf $(CURDIR)/doc/apidoc/*
22 22
	PYTHONPATH=src epydoc -o $(dir $@) -v \
23 23
		   --name Vigilo --url http://www.projet-vigilo.org \
24 24
		   --docformat=epytext $^
25 25

  
26
lint: bin/python
27
	./bin/python "$$(which pylint)" --rcfile=extra/pylintrc src/vigilo
26
lint:
27
	./pylint_vigiboard.py $(NAME)
28 28

  
29 29
tests:
30
	nosetests --with-coverage --cover-inclusive --cover-erase --cover-package vigilo tests
30
	nosetests --with-coverage --cover-inclusive --cover-erase --cover-package $(NAME) tests
31 31

  
32 32

  
33 33
.PHONY: all clean buildclean apidoc lint tests
buildout.cfg
6 6

  
7 7
[vigiboard]
8 8
recipe = zc.recipe.egg
9
eggs = ${buildout:eggs}
10 9
interpreter = python
10
eggs = ${buildout:eggs}
pylint_vigiboard.py
1
#!/usr/bin/python
2
"""
3
custom script that calls pylint with a special set of parameters.
4
"""
5
import sys
6
import os
7

  
8
# check if pylint is installed and import it
9
try:
10
    from pylint import lint
11
except ImportError:
12
    print "Can't import module pylint. Did you install it?"
13
    sys.exit(-1)
14

  
15
# either use the files given on the command line or all '*.py' files
16
# located in and beyond the working directory
17
if len(sys.argv) >1: 
18
    #may add some parsing for --switches?
19
    FILES = sys.argv[1:]
20
else:
21
    FILES = []
22
    for dirpath, dirnames, filenames in os.walk(os.getcwd()):
23
        FILES.extend(  
24
            os.path.join(dirpath, filename)
25
            for filename in filenames
26
            if ".py" == filename[-3:]
27
        )
28

  
29
# A list of messages that should not be printed by pylint. 
30
SUPRESSED_MESSAGES = [
31
#    'I0011', # Used when an inline option disable a message or a messages category
32
    'F0401', # Used when pylint has been unable to import a module.
33
# If you decided to globally switch of a certain message instead of doing so
34
# in file or scope where its generated then you can just uncomment it here.
35
# Or add it if its not in the list.
36
#   'E1101', # Used when a class is accessed for an unexistant member.
37
#   'E0602', # Used when an undefined variable is accessed.
38
#   'W0232', # Used when a class has no __init__ method, neither its parent 
39
#            # classes.
40
#   'W0401', # Used when `from module import *` is detected.
41
   'E0611', # Used when a name cannot be found in a module.
42
#   'W0611', # Used when an imported module or variable is not used.
43
   'R0201', # Used when a method doesn't use its bound instance, and so could 
44
            # be written as a function.
45
#   'W0102', # Used when a mutable value as list or dictionary is detected in a default
46
   	    # value for an argument.
47
   'W0142', # Used when a function or method is called using *args or **kwargs to
48
	    # dispatch arguments. This doesn't improve readility and should be
49
	    # used with care.
50
   'R0801', # Indicates that a set of similar lines has been detected among 
51
            # multiple file.
52
]
53

  
54
PARAMS = [
55
    #'--reports=n',
56
    '--include-ids=y',
57
    '--const-rgx=(([a-z_][a-z0-9_]*)|(__.*__))$', 
58
          '--disable-msg=%s' % ",".join(SUPRESSED_MESSAGES), 
59
]
60
PARAMS.extend(FILES)
61
lint.Run(PARAMS)
1
#!/usr/bin/python
2
"""
3
custom script that calls pylint with a special set of parameters.
4
"""
5
import sys
6
import os
7

  
8
# check if pylint is installed and import it
9
try:
10
    from pylint import lint
11
except ImportError:
12
    print "Can't import module pylint. Did you install it?"
13
    sys.exit(-1)
14

  
15
# either use the files given on the command line or all '*.py' files
16
# located in and beyond the working directory
17
if len(sys.argv) >1: 
18
    #may add some parsing for --switches?
19
    FILES = sys.argv[1:]
20
else:
21
    FILES = []
22
    for dirpath, dirnames, filenames in os.walk(os.getcwd()):
23
        FILES.extend(  
24
            os.path.join(dirpath, filename)
25
            for filename in filenames
26
            if ".py" == filename[-3:]
27
        )
28

  
29
# A list of messages that should not be printed by pylint. 
30
SUPRESSED_MESSAGES = [
31
#    'I0011', # Used when an inline option disable a message or a messages category
32
    'F0401', # Used when pylint has been unable to import a module.
33
# If you decided to globally switch of a certain message instead of doing so
34
# in file or scope where its generated then you can just uncomment it here.
35
# Or add it if its not in the list.
36
#   'E1101', # Used when a class is accessed for an unexistant member.
37
#   'E0602', # Used when an undefined variable is accessed.
38
#   'W0232', # Used when a class has no __init__ method, neither its parent 
39
#            # classes.
40
#   'W0401', # Used when `from module import *` is detected.
41
   'E0611', # Used when a name cannot be found in a module.
42
#   'W0611', # Used when an imported module or variable is not used.
43
   'R0201', # Used when a method doesn't use its bound instance, and so could 
44
            # be written as a function.
45
#   'W0102', # Used when a mutable value as list or dictionary is detected in a default
46
   	    # value for an argument.
47
   'W0142', # Used when a function or method is called using *args or **kwargs to
48
	    # dispatch arguments. This doesn't improve readility and should be
49
	    # used with care.
50
   'R0801', # Indicates that a set of similar lines has been detected among 
51
            # multiple file.
52
]
53

  
54
PARAMS = [
55
    #'--reports=n',
56
    '--include-ids=y',
57
    '--const-rgx=(([a-z_][a-z0-9_]*)|(__.*__))$', 
58
          '--disable-msg=%s' % ",".join(SUPRESSED_MESSAGES), 
59
]
60
PARAMS.extend(FILES)
61
lint.Run(PARAMS)
setup.py
17 17
        "TurboGears2 >= 2.0b7",
18 18
        "Catwalk >= 2.0.2",
19 19
        "Babel >=0.9.4",
20
        #can be removed iif use_toscawidgets = False
20
        #can be removed if use_toscawidgets = False
21 21
        "ToscaWidgets >= 0.9.7.1",
22 22
        "zope.sqlalchemy >= 0.4 ",
23 23
        "repoze.tm2 >= 1.0a4",
24 24
        
25 25
        "repoze.what-quickstart >= 1.0",
26 26

  
27
	# Requires postgresql8.3-devel for source install
27
        # Requires postgresql8.3-devel for source install
28 28
        "psycopg2",
29 29
        "MySQL-python",
30 30
        "tw.jquery",

Also available in: Unified diff