Skip to content

Commit

Permalink
new settings option to show problems panel after initial pass (#183)
Browse files Browse the repository at this point in the history
* add an option `showProblemsView`.

It controls if Problems View should open once after initial lint pass

* updated Changelog

* add option to README.md

* Update CHANGELOG.md

* Fix

* Fix MegaLinter

---------

Co-authored-by: Mikalai Kukhta <[email protected]>
Co-authored-by: Nicolas Vuillamy <[email protected]>
Co-authored-by: Nicolas Vuillamy <[email protected]>
  • Loading branch information
4 people authored Dec 17, 2023
1 parent d6fd068 commit 88b16bf
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
pull_request:
branches: [master]
branches: [main]

env: #Uncomment to activate variables below
# Apply linter fixes configuration
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix doc deployment
- Add stale workflow
- Added new setting `showProblemsView` that controls if Problems View should open after initial lint pass

## [3.0.0] 2023-12-17

Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Features

| Command | Description | Access |
|----------------------------------------|--------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| -------------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| **Analyze code** | Lint the code of the current file | Ctrl+Shift+F9<br/>Contextual</br>Status bar<br/>Commands |
| **Format** | Format the code of the current file | Shift+Alt+F<br/>Contextual</br>Commands |
| **Fix all auto-fixable problems** | Fix the code of the current file | Contextual</br>Commands |
Expand All @@ -40,20 +40,21 @@

## Extension Settings

| Parameter | 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](https://github.com/nvuillam/npm-groovy-lint#configuration) | .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 <br/>Example: C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\java.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) | false |
| Parameter | 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](https://github.com/nvuillam/npm-groovy-lint#configuration) | .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 <br/>Example: C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\java.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) | false |
| `groovyLint.showProblemsView` | Show Problems View once after start | false |

## Troubleshooting

Expand Down
5 changes: 3 additions & 2 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ async function updateStatus(status: StatusParams): Promise<any> {
else if (status.state.startsWith('lint.end')) {
// Update status list
statusList = statusList.filter(statusObj => statusObj.id !== status.id);
// Show markers panel just once (after the user can choose to close it)
if (outputChannelShowedOnce === false) {

// Show Problems panel just once (if user didn't choose otherwise)
if (outputChannelShowedOnce === false && vscode.workspace.getConfiguration('groovyLint').get('showProblemsView', true) === true) {
vscode.commands.executeCommand('workbench.panel.markers.view.focus');
outputChannelShowedOnce = true;
}
Expand Down
31 changes: 16 additions & 15 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Features

| Command | Description | Access |
|----------------------------------------|--------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| -------------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| **Analyze code** | Lint the code of the current file | Ctrl+Shift+F9<br/>Contextual</br>Status bar<br/>Commands |
| **Format** | Format the code of the current file | Shift+Alt+F<br/>Contextual</br>Commands |
| **Fix all auto-fixable problems** | Fix the code of the current file | Contextual</br>Commands |
Expand All @@ -40,20 +40,21 @@

## Extension Settings

| Parameter | 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](https://github.com/nvuillam/npm-groovy-lint#configuration) | .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 <br/>Example: C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\java.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) | false |
| Parameter | 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](https://github.com/nvuillam/npm-groovy-lint#configuration) | .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 <br/>Example: C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\java.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) | false |
| `groovyLint.showProblemsView` | Show Problems View once after start | false |

## Troubleshooting

Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@
"default": true,
"description": "Controls whether GroovyLint is enabled or not."
},
"groovyLint.showProblemsView": {
"scope": "resource",
"type": "boolean",
"default": true,
"description": "Show Problems View once after start."
},
"groovyLint.lint.trigger": {
"scope": "resource",
"type": "string",
Expand Down

0 comments on commit 88b16bf

Please sign in to comment.