Package: plone.recipe.sublimetext
ContentsIntroductionInstallationAvailable OptionsLinksKnown IssuesExample UsageContributorsChangelog1.3.0 (2019-02-04)1.2.0 (2018-03-05)1.1.6 (2018-01-24)1.1.5 (2017-10-31)1.1.4 (2017-08-11)1.1.3 (2017-07-30)1.1.2 (2017-07-02)1.1.1 (2017-06-20)1.1.0 (2017-06-07)1.0.1 (2017-05-16)1.0.0 (2017-05-15)Introductionplone.recipe.sublimetextis the buildout recipe forST3lover who wants python IDE like features while developing pythonBuildoutbased project. This tool will help them to create per project basis sublimetext settings with appropriate paths location assignment. Currentlyplone.recipe.sublimetextcomes with supporting settings forAnaconda(the all-in-one package),Jedi,Sublimelinter,Sublimelinter-Flake8,Sublimelinter-Pylint.
A general question may arise that why we will use this tool, whether we can createST3project settings easily (we have better knowledge overST3configuration)?
Well i completely agree with you, but if you want to get benefited fromAnacondaorJedi’s python autocompletion feature (basically I am lover of autocompletion), you have to add all eggs links forAnacondaorJedi’s paths settings and it is hard to manage eggs links manually if the size of project is big (think about anyPlonepowered project), besideSublimelinter-Pylintalso need list of paths to be added to sys.path  to find modules.InstallationInstallplone.recipe.sublimetextis simple enough, just need to create a section forsublimetextto your buildout. Before usingplone.recipe.sublimetextmake sureJedi,Sublimelinter,Sublimelinter-Flake8and/orSublimelinter-Pylintplugins are already installed at yourST3. You could follow full [instruction here] if not yourST3setup yet. Flake8 linter needflake8 executableavailable globally (unless you are going to use local flake8), also it is recommended you install some awsome flake8 plugins (flake8-isort, flake8-coding, pep8-naming, flake8-blind-except, flake8-quotes and more could find in pypi)Example Buildout:[buildout]
parts += sublimetext

[sublimetext]
recipe = plone.recipe.sublimetext
eggs = ${buildout:eggs}
jedi-enabled = True
sublimelinter-enabled = True
sublimelinter-pylint-enabled = TrueAvailable OptionseggsRequired: YesDefault: NoneYour project’s list of eggs, those are going to be added in path location forJediand/orSublimelinter-PylintorAnaconda.overwriteRequired: NoDefault: FalseThis option indicates whether existing settings should be cleaned first or just updating changes.
This situation may happen, you did create settings file manually with other configuration (those are not managed byplone.recipe.sublimetext) and you want keep those settings intact.python-executableRequired: NoDefault:plone.recipe.sublimetextwill find current python executable path.The python executable path for current project, if you are using virtual environment then should be that python path. FYI: ${home} and ${project} variable should work.project-nameRequired: NoDefault: if you have a existingST3project file(settings file) in project/buildout’s root directory,plone.recipe.sublimetextwill choose it asproject-name, other than project/buildout directory name will become asproject-nameDon’t add suffix.sublime-project, when you provide the project name.jedi-enabledRequired: NoDefault: FalseThis option is related to enable/disable SublimeJedijedi-use-omeletteRequired: NoDefault: FalseUse the omelette as basis for jedi autocompletion and go-to-definition. Seecollective.recipe.omeletteomelette-locationRequired: NoDefault: ${buildout:directory}/parts/omelette - the default omelette location.For use with jedi-use-omelette, but unless the omelette is installed at a custom location, the default should be fine.sublimelinter-enabledRequired: NoDefault: FalseWhetherSublimelinter’s features you want to use or not.sublimelinter-pylint-enabledRequired: NoDefault: FalseIf you want to useSublimelinter-Pylintor not;sublimelinter-enabledoption will be respected, means if parent option is set as disabled but you enable this option will not work.sublimelinter-pylint-executableRequired: NoDefault: ‘’You could provide buildout specific pylint executable. It is very flexible way to avoid using global pylint.
Example of relative path usecase:
i.)${buildout:directory}/bin/pylintii.)$project_path/bin/pylintiii.)./bin/pylintiv.)~/path/bin/pylintsublimelinter-pylint-argsRequired: NoDefault: ‘’@see bellow atsublimelinter-flake8-argssection for full detail.sublimelinter-flake8-enabledRequired: NoDefault: FalseWhether you want to useSublimelinter-Flake8or not. Likesublimelinter-pylint-enabledparent option will be respected.sublimelinter-flake8-executableRequired: NoDefault: ‘’Project specificFlake8executable path, this will give you lots flexibility over using globalFlake8executable, because each project might have separatePythonversion. You could use buildout or user’s relative directory path and it is very convenient for collboration works where all members’ absolute path of flake8 excecutable may not be the same!
Example of relative path usecase:
i.)${buildout:directory}/bin/flake8ii.)$project_path/bin/flake8iii.)./bin/flake8iv.)~/path/bin/flake8sublimelinter-flake8-argsRequired: NoDefault: ‘’It is possible toprovide arguments (options)forflake8executable project specific.
You have to follow a simple format to providemultiple arguments akaflake8 options thanks to buildout for making our life easy. Format{optionname}={optionvalue(optional if the arg boolen type)}max-line-length=90, it is remarkable that--prefix is not required, you can provide multiple arguments separated byspaceand/ornewlinesublimelinter-flake8-args = max-line-length=90  –show-sourcesublimelinter-flake8-args = max-line-length=90  –show-sourceoutput-file=path_to_fileanaconda-enabledRequired: NoDefault: FalseThis option is related to whether you want to enableAnacondathe all-in-one python IDE package!anaconda-linting-enabledRequired: NoDefault: TrueIf want to other library for liniting (i.e sublimelinter), keep it disabled, other than should be enabled. Like other parent options, it will respect parent (anaconda-enabled) option.anaconda-completion-enabledRequired: NoDefault: TrueAnaconda is usingJediengine for autocompletion, but if you want to use Sublime-Jedi other than provided by Anaconda, make it disabled.anaconda-pylint-enabledRequired: NoDefault: FalseBy defaultAnacondaliniting doing validation using PyFlakes, PEP8, PEP257. But you can use Pylint instead of PyFlakes by enabling this option.anaconda-validate-importsRequired: NoDefault: TrueIt is always good that you want to see any invalid imports (for example:from fake.foo import bar), but if you don’t want this just disabled this option.anaconda-pep8-ignoresRequired: NoDefault: ‘’If you want ignore some pep8 checklist (i.e N802 is for pep8 naming). Each ignore should be separated byspaceand/ornewline.anaconda-pep257-enabledRequired: NoDefault: FalseIndicates whether you want to activepep257checklist by anaconda.anaconda-pep257-ignoresRequired: NoDefault: ‘’If you want ignore some pep8 checklist (i.e N802 is for pep8 naming). Each ignore should be separated byspaceand/ornewline.ignore-developRequired: NoDefault: FalseIf you don’t want development eggs, should go for autocompletion.ignoresRequired: NoDefault: “”If you want specific eggs should not go for autocompletion.packagesRequired: NoDefault: “”Location of some python scripts or non standard modules (don’t have setup file), you want to be in system path.LinksCode repository:https://github.com/collective/plone.recipe.sublimetextContinuous Integration:https://travis-ci.org/collective/plone.recipe.sublimetextIssue Tracker:https://github.com/collective/plone.recipe.sublimetext/issuesKnown IssuesSublimelinter-Flake8might stop working ifflake8-plone-apiis installed as until 1.2 version,flake8-plone-apidon’t support SublimeText (linting), see pull requesthere. That means upcoming version will support hopefully. It could happen, either you are using global or virtualenv flake8. You can see error inST3console:flake8_plone_api-1.2-py2.7.egg/flake8_plone_api.py", line 16, in run
with open(self.filename) as f:
IOError: [Errno 2] No such file or directory: 'stdin'Example UsageMinimal buildout::>>> write('buildout.cfg',
... """
... [buildout]
... develop = .
... eggs =
...     zc.buildout
... parts = sublimetext
...
... [sublimetext]
... recipe = plone.recipe.sublimetext
... project-name = plone-recipe-sublime
... eggs = ${buildout:eggs}
... jedi-enabled = True
... """)
>>> system(buildout + ' -c buildout.cfg')
>>> import os
>>> os.path.exists('plone-recipe-sublime.sublime-project')
TrueStandard buildout:>>> write('buildout.cfg',
... """
... [buildout]
... develop = .
... eggs =
...     zc.buildout
... parts = sublimetext
...
... [sublimetext]
... recipe = plone.recipe.sublimetext
... project-name = plone-recipe-sublime
... eggs = ${buildout:eggs}
... jedi-enabled = True
... sublimelinter-enabled = True
... sublimelinter-flake8-enabled = True
... sublimelinter-flake8-executable = ${buildout:directory}/bin/flake8
... """)
>>> system(buildout + ' -c buildout.cfg')
>>> import json
>>> settings = json.loads(read('plone-recipe-sublime.sublime-project'))
>>> 'Sublimelinter.linters.flake8.enable' in settings['settings']
TrueMuilti linters and without project name:>>> write('buildout.cfg',
... """
... [buildout]
... develop = .
... eggs =
...     zc.buildout
... parts = sublimetext
...
... [sublimetext]
... recipe = plone.recipe.sublimetext
... eggs = ${buildout:eggs}
... jedi-enabled = True
... sublimelinter-enabled = True
... sublimelinter-flake8-enabled = True
... sublimelinter-flake8-executable = ${buildout:directory}/bin/flake8
... sublimelinter-pylint-enabled = True
... """)
>>> system(buildout + ' -c buildout.cfg')(project filename should beplone-recipe-sublime.sublime-projectas previously generated):>>> settings = json.loads(read('plone-recipe-sublime.sublime-project'))
>>> 'pylint' in settings['Sublimelinter']['linters']
TrueUsages Anaconda for all purpose (linting, autocompletion) and rest of all are not used:>>> write('buildout.cfg',
... """
... [buildout]
... develop = .
... eggs =
...     zc.buildout
... parts = sublimetext
...
... [sublimetext]
... recipe = plone.recipe.sublimetext
... project-name = plone-recipe-sublime
... eggs = ${buildout:eggs}
... anaconda-enabled = True
... anaconda-pep8-ignores =
...     N802
... """)
>>> system(buildout + ' -c buildout.cfg')
>>> import json
>>> settings = json.loads(read('plone-recipe-sublime.sublime-project'))
>>> 'build_systems' in settings.keys()
True
>>> 'extra_paths' in settings['settings'].keys()
True
>>> settings['settings']['anaconda_linting']
True
>>> settings['settings']['use_pylint']
FalseFlake8 linter with flake8 arguments:>>> write('buildout.cfg',
... """
... [buildout]
... develop = .
... eggs =
...     zc.buildout
... parts = sublimetext
...
... [sublimetext]
... recipe = plone.recipe.sublimetext
... project-name = plone-recipe-sublime
... eggs = ${buildout:eggs}
... jedi-enabled = True
... sublimelinter-enabled = True
... sublimelinter-flake8-enabled = True
... sublimelinter-flake8-executable = ${buildout:directory}/bin/flake8
... sublimelinter-flake8-args = max-complexity=10  max-line-length=119
...                             exclude=docs,*.egg.,omelette
... """)
>>> system(buildout + ' -c buildout.cfg')(project filename should beplone-recipe-sublime.sublime-project):>>> settings = json.loads(read('plone-recipe-sublime.sublime-project'))
>>> len(settings['settings']['Sublimelinter.linters.flake8.args']) == 3
TrueContributorsMd Nazrul Islam<email2nazrul@gmail.com>, Original AuthorSune Brøndum Wøller [sunew]Changelog1.3.0 (2019-02-04)New features:Sublime​Linter linter arguments are possibleto provide linter specific options. Currentlysublimelinter-flake8andsublimelinter-pylintare supported.New style Sublime​Linter linter settingsgeneration has been added. [nazrulworld]More options (anaconda-pep257-enabled,anaconda-pep257-ignores) added for Anaconda settings.1.2.0 (2018-03-05)New features:(breaking) Sublime​Linter 4.x version support is added, that means older than version 4 might not working (although not tested.). If you face any problem, we suggest either you will update Sublime​Linter version or use older version ofplone.recipe.sublimetext(1.1.6)pylint executable path now can be provided.1.1.6 (2018-01-24)Set a default folder_exclude_patterns for performance, and also to eliminate noise when looking up packages.Set follow_symlinks to true.split out omelette in own project folder setting, for being able to exclude ‘parts’.
[sunew]1.1.5 (2017-10-31)Flake8 executable path: Enable to usebuildout relative/user’s home relativepath. Means now it is possible to use buildout, sublimetext style relative path.
[nazrulworld]1.1.4 (2017-08-11)Enable using the omelette as a basis for jedi.
[sunew]1.1.3 (2017-07-30)Repository ownership transfered toPlone Collective1.1.2 (2017-07-02)Bugfixes:[#8]Install using pip in virtualenv got error1.1.1 (2017-06-20)Bugfixes:[#7]`python_interpreter` value as list but expected as string.
[nazrulworld]1.1.0 (2017-06-07)New features:[#4]Anaconda support[nazrulworld]1.0.1 (2017-05-16)Bugfixes:[#1]Required options for sublime text project file is missing1.0.0 (2017-05-15)Initial release.
[nazrulworld]