Lint (code quality), Format and Auto-fix your groovy files and Jenkinsfile Visual Studio Code extension embedding npm-groovy-lint, itself embedding CodeNarc - You can configure the rules by defining a
.groovylintrc.json file - If you use CI, you can integrate Mega-Linter in your workflow, to make sure all your sources (groovy and other) are clean
FeaturesCommand | Description | Access |
---|
Analyze code | Lint the code of the current file | Ctrl+Shit+F9 Contextual Status bar Commands | Format | Format the code of the current file | Shift+Alt+F Contextual Commands | Fix all auto-fixable problems | Fix the code of the current file | Contextual Commands | Lint folder | Lint all applicable files of a folder | Contextual | Fix single error | Apply quick fix for a single problem | Quick Fix Diagnostic | Fix rule in entire file | Apply quick fix for all problems related to the same rule in the current file | Quick Fix Diagnostic | Disable rule for this line | Disable rule only for current line | Quick Fix Diagnostic | Disable rule for this entire file | Disable rule in the entire file | Quick Fix Diagnostic | Disable rule for this entire project | Updates configuration file (usually .groovylintrc.js in root folder) to disable this rule) | Quick Fix Diagnostic |
- Contextual: right click in source code or on folder
- Commands: Ctrl+Shift+P then type command name
- Status bar: GroovyLint status item at the bottom right
- Quick Fix: Hover an underlined part of the code after a lint, click Quick Fix then select action to perform
- Diagnostic: Right click on a diagnostic in Problems section
Extension SettingsParameter | Description | Default |
---|
groovyLint.enable | Controls whether GroovyLint is enabled or not | true | groovyLint.lint.trigger | Run the linter on save (onSave), on type (onType) , or on user request | onSave | groovyLint.format.enable | Controls whether the groovy formatter is enabled or not | true | groovyLint.fix.enable | Run the auto-fixer on save (onSave), on type (onType) , or on user request | true | groovyLint.fix.trigger | Run the fixer on save (onSave), or on user request | user | groovyLint.basic.loglevel | Linting error level (error, warning,info) | info | groovyLint.basic.verbose | Turn on to have verbose logs | false | groovyLint.basic.config | NPM groovy lint configuration file | .groovylintrc.json | groovyLint.debug.enable | Display more logs in VsCode Output panel (select 'GroovyLint') for issue investigation | false | groovyLint.java.executable | Override java executable to use Example: C:Program FilesJavajdk1.8.0_144binjava.exe | java | groovyLint.java.options | Override java options to use | '-Xms256m,-Xmx2048m' | groovyLint.insight.enable | Allow to send anonymous usage statistics used only to improve the tool (we will of course never send your code) | true |
TroubleshootingNode.js version 12 or higher is required to run this extension. If you can't upgrade, you can use nvm to have different node versions on your computer Java version 8 or higher is required to run this extension As CodeNarc is run in background with java/groovy, performances could be improved on large files (do not hesitate to provide advices !)But do not worry, as the groovy linting is provided by a background local server, your VsCode won't be slowed.
ContributeContributions are very welcome on : - NPM Groovy Lint (linter called by this extension)
Please follow Contribution instructions Special Thanks- yuvmel, for his great support on #18 that allowed VsCode Groovy Lint to work much better on Mac, Linux, and with other diagnostic extensions
Release Notes[1.3.0] 2020-11-15- Upgrade to npm-groovy-lint v8.0.0
- Upgrade to CodeNarc 2.0.0
- Improve performances
- Fix bugs
[1.2.7] 2020-09-04- Upgrade to npm-groovy-lint v7.5.4
[1.2.6] 2020-09-02- Upgrade to npm-groovy-lint v7.5.2
- Fix crash when empty groovy file
- Fix crash when non-sense groovy file
[1.2.3] 2020-08-29- Fix bug on Windows when username contains space(s)
[1.2.2] 2020-08-21- Allow user to hide future npm-groovy-lint error messages
- Manage correctly user choice
Never for tabs auto-replacement by spaces - Upgrade to npm-groovy-lint v7.4.0
[1.2.0] 2020-08-15- Upgrade to npm-groovy-lint v7.3.0
- Allow to link to CodeNarc RuleSet files from
.groovylintrc.json , using property 'codenarcRulesets' . Warning: doing so means that all other properties of config file will be ignored.
[1.1.1] 2020-08-11- Upgrade to npm-groovy-lint v7.2.0
- Upgradejava-caller to v2.0.0 : better performances
[1.1.0] 2020-08-10- Upgrade to npm-groovy-lint v7.1.0
- Externalize JavaCaller class into a separate package java-caller and use it
PREVIOUS VERSIONSSee complete CHANGELOG |
- Downloadable quick ref pdfs. We have compiled the most used, and most useful, keyboard shortcuts into a downloadable pdf file. We have two versions, one that shows shortcuts for Visual Studio for Mac, and a version that shows Visual Studio shorts side-by-side for users that have prior experience with Visual Studio when using Windows.
- Format code visual studio shortcut mac Grepper Account Login Required I tried to indent my code in the visual studio code. I searched and found that Ctrl + F + K should be working, but not. I tried cmd + k + f too, but it still doesn't work. I hope you can help me! Format the class file and arrange fields, properties, and methods according to.
Visual Studio Code Mac Download
Visual Studio Community For Mac
Visual Studio For Mac Tutorial
Format Document (Ctrl+K, Ctrl+D) so type Ctrl+K, and then Ctrl+D as it is a sequence Format Selection (Ctrl+K, Ctrl+F) Recommended Training – Treehouse From beginner to advanced, our recommended coding training is Treehouse.
Comments are closed.