Skip to content

Commit b17b4cd

Browse files
committed
Add "add-ignore" config setting
1 parent dbaed40 commit b17b4cd

File tree

6 files changed

+28
-12
lines changed

6 files changed

+28
-12
lines changed

Diff for: .sublimelinterrc

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
"@python": 3,
33
"linters": {
44
"pep257": {
5-
"ignore": ["D202"]
5+
"add-ignore": ["D202"]
66
},
77
"pep8": {
88
"max-line-length": 120
9-
},
10-
"pep257": {
11-
"ignore": ["D202"]
129
}
1310
}
1411
}

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ install:
88
# command to run tests
99
script:
1010
- flake8 . --max-line-length=120
11-
- pep257 . --ignore=D202
11+
- pep257 . --add-ignore=D202

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ In addition to the standard SublimeLinter settings, SublimeLinter-pep257 provide
4242
|Setting|Description|
4343
|:------|:----------|
4444
|ignore|A comma-separated list of error codes to ignore|
45+
|add-ignore|A comma-separated list of error codes to add the the default ignore list|
4546

4647
## Contributing
4748
If you would like to contribute enhancements or fixes, please do the following:

Diff for: linter.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717

1818
class PEP257(PythonLinter):
19-
2019
"""Provides an interface to the pep257 python module/script."""
2120

2221
syntax = 'python'
@@ -31,9 +30,10 @@ class PEP257(PythonLinter):
3130
line_col_base = (1, 0) # pep257 uses one-based line and zero-based column numbers
3231
tempfile_suffix = 'py'
3332
defaults = {
34-
'--ignore=,': ''
33+
'--add-ignore=': '',
34+
'--ignore=': ''
3535
}
36-
inline_overrides = ('ignore',)
36+
inline_overrides = ('ignore','add-ignore')
3737
module = 'pep257'
3838
check_version = True
3939

@@ -47,10 +47,12 @@ def check(self, code, filename):
4747
self.checker = self.module.PEP257Checker()
4848

4949
options = {
50-
'ignore': []
50+
'ignore': [],
51+
'add-ignore': []
5152
}
5253
type_map = {
53-
'ignore': []
54+
'ignore': [],
55+
'add-ignore': []
5456
}
5557

5658
self.build_options(options, type_map)
@@ -59,12 +61,13 @@ def check(self, code, filename):
5961
persist.printf('{} options: {}'.format(self.name, options))
6062

6163
ignore = options['ignore']
64+
add_ignore = options['add-ignore']
6265
errors = []
6366

6467
for error in self.checker.check_source(code, os.path.basename(filename)):
6568
code = getattr(error, 'code', None)
6669

67-
if code is not None and code not in ignore:
70+
if code is not None and code not in ignore and code not in add_ignore:
6871
errors.append(str(error))
6972

7073
return '\n'.join(errors)

Diff for: messages.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"install": "messages/install.txt",
3-
"1.1.10": "messages/1.1.10.txt"
3+
"1.1.10": "messages/1.1.10.txt",
4+
"2.0.0": "messages/2.0.0.txt"
45
}

Diff for: messages/2.0.0.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SublimeLinter-pep257
2+
-------------------------------
3+
4+
"add-ignore" config option has been added to SublimeLinter-pep257.
5+
This addition was because of changes to "ignore" functionality. Both
6+
options can now be found in the SublimeLinter User settings. Some
7+
may find that their "ignore" setting is now broken. If that is the case,
8+
you may want to use the "add-ignore" config setting instead. Below
9+
you will find a brief description of each setting to help you understand
10+
11+
"ignore": overrides the default list of disabled errors
12+
"add-ignore": appends list on top of default list of disabled errors
13+
14+
As always thank you for using SublimeLinter!

0 commit comments

Comments
 (0)