1 |
commit: 71859a7defe5700b1bf8442657913a2be1dafdfb |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org> |
3 |
AuthorDate: Thu Nov 22 22:11:35 2012 +0000 |
4 |
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com> |
5 |
CommitDate: Thu Nov 22 22:11:35 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71859a7d |
7 |
|
8 |
Fix some typos and improve amount of whitespace. |
9 |
|
10 |
--- |
11 |
pym/repoman/checks.py | 20 ++++++++++---------- |
12 |
1 files changed, 10 insertions(+), 10 deletions(-) |
13 |
|
14 |
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py |
15 |
index 0cae50d..f8252b5 100644 |
16 |
--- a/pym/repoman/checks.py |
17 |
+++ b/pym/repoman/checks.py |
18 |
@@ -69,7 +69,7 @@ class EbuildHeader(LineCheck): |
19 |
Copyright header errors |
20 |
CVS header errors |
21 |
License header errors |
22 |
- |
23 |
+ |
24 |
Args: |
25 |
modification_year - Year the ebuild was last modified |
26 |
""" |
27 |
@@ -112,7 +112,7 @@ class EbuildWhitespace(LineCheck): |
28 |
ignore_line = re.compile(r'(^$)|(^(\t)*#)') |
29 |
ignore_comment = False |
30 |
leading_spaces = re.compile(r'^[\S\t]') |
31 |
- trailing_whitespace = re.compile(r'.*([\S]$)') |
32 |
+ trailing_whitespace = re.compile(r'.*([\S]$)') |
33 |
|
34 |
def check(self, num, line): |
35 |
if self.leading_spaces.match(line) is None: |
36 |
@@ -169,7 +169,7 @@ class EbuildQuote(LineCheck): |
37 |
r'\}?[^"\'\s]*(\s|$)') |
38 |
cond_begin = re.compile(r'(^|\s+)\[\[($|\\$|\s+)') |
39 |
cond_end = re.compile(r'(^|\s+)\]\]($|\\$|\s+)') |
40 |
- |
41 |
+ |
42 |
def check(self, num, line): |
43 |
if self.var_reference.search(line) is None: |
44 |
return |
45 |
@@ -239,11 +239,11 @@ class Eapi3EbuildAssignment(EbuildAssignment): |
46 |
return eapi_supports_prefix(eapi) |
47 |
|
48 |
class EbuildNestedDie(LineCheck): |
49 |
- """Check ebuild for nested die statements (die statements in subshells""" |
50 |
- |
51 |
+ """Check ebuild for nested die statements (die statements in subshells)""" |
52 |
+ |
53 |
repoman_check_name = 'ebuild.nesteddie' |
54 |
nesteddie_re = re.compile(r'^[^#]*\s\(\s[^)]*\bdie\b') |
55 |
- |
56 |
+ |
57 |
def check(self, num, line): |
58 |
if self.nesteddie_re.match(line): |
59 |
return errors.NESTED_DIE_ERROR |
60 |
@@ -465,13 +465,13 @@ class InheritEclass(LineCheck): |
61 |
self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re) |
62 |
# Match when the function is preceded only by leading whitespace, a |
63 |
# shell operator such as (, {, |, ||, or &&, or optional variable |
64 |
- # setting(s). This prevents false postives in things like elog |
65 |
+ # setting(s). This prevents false positives in things like elog |
66 |
# messages, as reported in bug #413285. |
67 |
self._func_re = re.compile(r'(^|[|&{(])\s*(\w+=.*)?\b(' + '|'.join(funcs) + r')\b') |
68 |
|
69 |
def new(self, pkg): |
70 |
self.repoman_check_name = 'inherit.missing' |
71 |
- # We can't use pkg.inherited because that tells us all the eclass that |
72 |
+ # We can't use pkg.inherited because that tells us all the eclasses that |
73 |
# have been inherited and not just the ones we inherit directly. |
74 |
self._inherit = False |
75 |
self._func_call = False |
76 |
@@ -777,7 +777,7 @@ class PortageInternal(LineCheck): |
77 |
repoman_check_name = 'portage.internal' |
78 |
ignore_comment = True |
79 |
# Match when the command is preceded only by leading whitespace or a shell |
80 |
- # operator such as (, {, |, ||, or &&. This prevents false postives in |
81 |
+ # operator such as (, {, |, ||, or &&. This prevents false positives in |
82 |
# things like elog messages, as reported in bug #413285. |
83 |
re = re.compile(r'^(\s*|.*[|&{(]+\s*)\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b') |
84 |
|
85 |
@@ -788,7 +788,6 @@ class PortageInternal(LineCheck): |
86 |
return ("'%s'" % m.group(2)) + " called on line: %d" |
87 |
|
88 |
class PortageInternalVariableAssignment(LineCheck): |
89 |
- |
90 |
repoman_check_name = 'portage.internal' |
91 |
internal_assignment = re.compile(r'\s*(export\s+)?(EXTRA_ECONF|EXTRA_EMAKE)\+?=') |
92 |
|
93 |
@@ -799,6 +798,7 @@ class PortageInternalVariableAssignment(LineCheck): |
94 |
e = 'Assignment to variable %s' % match.group(2) |
95 |
e += ' on line: %d' |
96 |
return e |
97 |
+ |
98 |
_base_check_classes = (InheritEclass, LineCheck, PhaseCheck) |
99 |
_constant_checks = tuple(chain((v() for k, v in globals().items() |
100 |
if isinstance(v, type) and issubclass(v, LineCheck) and v not in _base_check_classes), |