Package: voicelint
voicelintvoicelintis apylintplug-in/extension designed to aid users ofCaster,adragonflybased toolkit for programming by voice, when writing their own grammars by catching some common or annoying mistakes.ContentsGetting StartedCurrently Recognized Errors/MistakesMimic ErrorsPause errorsForgeting Conditional ImportVarious Rule Details ErrorsKey-Text-Mouse Separated strings ErrorsBringApp and StartApp no dynamic stringsLicenseGetting StartedIn case you have never heard before,pylintis a popular static analysis tool, which can help you catch various errors and/or help you improve code quality. You can install it withpippython3-mpipinstallpylintand can be integrated with many editors via available extensions. For instance, you can follow instructionsherefor VSCode and for sublime you can useSublimeLinterin combination withSublimeLinter-pylintOnce you have done that, you need to installvoicelintby similarly executingpython37-mpipinstallvoicelintand configurepylintto use this plug-in for our grammars!Now the easiest way to configurepylintis via a.pylintrcfile, which you should place in the root directory you interested in. For our use case, that is the rules folder of the caster user directory, so it should be something likeC:\Users\%USERNAME%\AppData\Local\caster\rulesif you're in the latest version of caster. To tellpylintto load our plug-in, we need to set theload-pluginssetting, so our file should look something like[MASTER]load-plugins=voicelintNow we are goot and set with that,we are now faced with a different technicality that does not have to do with our plug-in but rather linting caster grammars in general. In particular, python allows manipulating during runtime  the set of directories it searches for modules import, which creates headaches for static analysis tools as they cannot know in advance which directories will be added or removed. Caster relies heavily on these feature and as a consequence pylint will complain about being unable to find thecastervoicemodules.To sidestep this issue, we need to inform pylint of the directories Castor adds to the path and we can do that by adding the following lines (adjust for the paths used in your computer)[MASTER]
init-hook='import sys; sys.path.append("C:\\Users\\%USERNAME%\\AppData\\Local\\caster\\rules"); sys.path.append("C:\\Users\\%USERNAME%\\Documents\\Github\\Caster")'

load-plugins=voicelintand now you should be up and running!!!Currently Recognized Errors/MistakesNot that many for the time being but I hope they help!Mimic ErrorsMimic(["hello","world"])# wrongMimic("hello world")# wrongvsMimic("hello","world")# `,` separated single wordsMimic(keyword_name_other_than_extra="something")# only allowed keyword is `extra`Pause errorsPause(10)vsPause("10")# must be a string instead of integerForgeting Conditional ImportWhen importing support files, 99% of the time you should be using try except blocks to allow overriding from the user directoryfromcastervoice.rules.apps.editor.eclipse_rules.eclipse_supportimportec_convstry:# Try first loading from caster user directoryfromeclipse_supportimportec_conexceptImportError:fromcastervoice.rules.apps.editor.eclipse_rules.eclipse_supportimportec_conVarious Rule Details Errorsfor exampleclassExampleRule(MergeRule):blah,blah,blahdefget_rule():returnExampleRule,RuleDetails(ccrtype=CCRType.GLOBAL,executable="chrome")vsreturnExampleRule,RuleDetails(ccrtype=CCRType.APP,executable="chrome")and many others for the current version of Caster (28/07/2020)Key-Text-Mouse Separated strings ErrorsAll the key presses should be in a single stringKey("c-a","c-c")Text("nice","day")Mouse("[12,100]","(4,5)")vsKey("c-a,c-c")Text("nice day")Mouse("[12,100],(4,5)")BringApp and StartApp no dynamic stringsBringApp("program","%(data)s")vsFunction(lambdadata:BringApp('program',data.format()).execute())Licensevoicelint is licensed under 2-clause BSDBSD 2-Clause License

Copyright (c) 2020, Kitsios Panagiotis
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.