@@ -33,63 +33,63 @@ The pragma controls can disable / enable:
33
33
34
34
* All the violations on a single line
35
35
36
- .. sourcecode :: python
36
+ .. sourcecode :: python
37
37
38
- a, b = ... # pylint: disable=unbalanced-tuple-unpacking
38
+ a, b = ... # pylint: disable=unbalanced-tuple-unpacking
39
39
40
40
* All the violations on the following line
41
41
42
- .. sourcecode :: python
42
+ .. sourcecode :: python
43
43
44
- # pylint: disable-next=unbalanced-tuple-unpacking
45
- a, b = ...
44
+ # pylint: disable-next=unbalanced-tuple-unpacking
45
+ a, b = ...
46
46
47
47
* All the violations in a single scope
48
48
49
- .. sourcecode :: python
49
+ .. sourcecode :: python
50
50
51
- def test():
52
- # Disable all the no-member violations in this function
53
- # pylint: disable=no-member
54
- ...
51
+ def test():
52
+ # Disable all the no-member violations in this function
53
+ # pylint: disable=no-member
54
+ ...
55
55
56
56
* All the violations in a `block `. For instance, each separate branch of an
57
57
``if `` statement is considered a separate block, as in the following example:
58
58
59
- .. sourcecode :: python
59
+ .. sourcecode :: python
60
60
61
- def meth5(self):
62
- # pylint: disable=no-member
63
- # no error
64
- print(self.bla)
65
- if self.blop:
66
- # pylint: enable=no-member
67
- # enable all no-members for this block
68
- print(self.blip)
69
- else:
70
- # This is affected by the scope disable
71
- print(self.blip)
61
+ def meth5(self):
62
+ # pylint: disable=no-member
63
+ # no error
64
+ print(self.bla)
65
+ if self.blop:
72
66
# pylint: enable=no-member
67
+ # enable all no-members for this block
68
+ print(self.blip)
69
+ else:
70
+ # This is affected by the scope disable
71
+ print(self.blip)
72
+ # pylint: enable=no-member
73
+ print(self.blip)
74
+ if self.blop:
75
+ # pylint: disable=no-member
76
+ # disable all no-members for this block
77
+ print(self.blip)
78
+ else:
79
+ # This emits a violation
73
80
print(self.blip)
74
- if self.blop:
75
- # pylint: disable=no-member
76
- # disable all no-members for this block
77
- print(self.blip)
78
- else:
79
- # This emits a violation
80
- print(self.blip)
81
81
82
82
83
83
* If the violation occurs on a block starting line, then it applies only to that line
84
84
85
- .. sourcecode :: python
85
+ .. sourcecode :: python
86
86
87
- if self.blop: # pylint: disable=no-member; applies only to this line
88
- # Here we get an error
89
- print(self.blip)
90
- else:
91
- # error
92
- print(self.blip)
87
+ if self.blop: # pylint: disable=no-member; applies only to this line
88
+ # Here we get an error
89
+ print(self.blip)
90
+ else:
91
+ # error
92
+ print(self.blip)
93
93
94
94
95
95
0 commit comments