Skip to content

Commit 03ddeb9

Browse files
committed
Updated project settings guide
1 parent a7ef6c8 commit 03ddeb9

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,42 +45,34 @@ 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-
### Settings quick start
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.
4950

50-
One way to adjust linting settings for your preferences is to use Sublime Text project functionality.
51-
This is to avoid extraneous red markers all over your source code files, when pep8 kicks in and some of your coding style does not suit for pep8. A Sublime Text project consists of working folders and settings applied when editing the project files.
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):
5252

53-
* Create a Sublime Text project (*Project* -> *New workspace for a project*)
53+
* If you have not already created a project in Sublime Text, select `Project -> Save Project As...`.
5454

55-
* Then edit project settings (*Project* -> *Edit project*)
55+
* Select `Project -> Edit Project`.
5656

57-
* Drop in your preferences for the Python interpreter and linting settings. An example below:
57+
* At the **top** level of the project’s JSON data, add the following:
5858

59+
"SublimeLinter":
5960
{
60-
"SublimeLinter":
61+
"@python": 2.7,
62+
"linters":
6163
{
62-
"@python": 2.7,
63-
"linters":
64+
"pep8":
6465
{
65-
"pep8":
66-
{
67-
"@disable": false,
68-
"ignore": "E501,E128,E127",
69-
"max-line-length": 512
70-
}
66+
"@disable": false,
67+
"ignore": "E127,E128",
68+
"max-line-length": 512
7169
}
72-
},
73-
"build_systems":
74-
...
70+
}
7571
}
7672

77-
* You will find pep8 error codes from Sublime Text console (*View* -> *Show Console*). Put ones you wish to disable to `ignore` setting
73+
* Save the file.
7874

79-
* Save the settings file
80-
81-
* Edit and save any Python source code file and you should see the new linting settings to take effect
82-
83-
* You can add any number of working folders to the project with *Project* -> *Add Folder to Project*
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.
8476

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

0 commit comments

Comments
 (0)