Skip to content

Commit b36d6ac

Browse files
committed
Merge pull request #6 from miohtama/master
Make it easier to get started adjusting PEP8
2 parents 8d8942e + 03ddeb9 commit b36d6ac

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,35 @@ In addition to the standard SublimeLinter settings, SublimeLinter-pep8 provides
4545
|select|A comma-separated list of error codes to select, overrides ignore| |✓|
4646
|max-line-length|The maximum allowed line length. `null` uses the PEP8 default of 79.|✓| |
4747

48+
### Implementing per-project settings
49+
Typically you will want to configure pep8 on a per-project basis to conform to the coding style for all files in that project. Usually you want to ignore certain pep8 warnings. First you need to find the pep8 error codes from the [pep8 documentation](http://pep8.readthedocs.org/en/latest/intro.html#error-codes). Then you need to configure the pep8 linter to ignore those warnings.
50+
51+
For example, let’s say your project requires python 2.7+, you want the maximum line length to be 512, and you want to ignore warnings about visual indents (pep8 errors E127 and E128):
52+
53+
* If you have not already created a project in Sublime Text, select `Project -> Save Project As...`.
54+
55+
* Select `Project -> Edit Project`.
56+
57+
* At the **top** level of the project’s JSON data, add the following:
58+
59+
"SublimeLinter":
60+
{
61+
"@python": 2.7,
62+
"linters":
63+
{
64+
"pep8":
65+
{
66+
"@disable": false,
67+
"ignore": "E127,E128",
68+
"max-line-length": 512
69+
}
70+
}
71+
}
72+
73+
* Save the file.
74+
75+
Any time you edit the project and change a linter’s settings, all open files that use that linter will be re-linted to reflect the new settings.
76+
4877
## Contributing
4978
If you would like to contribute enhancements or fixes, please do the following:
5079

0 commit comments

Comments
 (0)