Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying More Context in Lint Results #60

Open
notJoon opened this issue Sep 3, 2024 · 0 comments
Open

Displaying More Context in Lint Results #60

notJoon opened this issue Sep 3, 2024 · 0 comments
Assignees
Labels
A-lint Adding new lints AST Require: working with AST or static analysis T-format Type: related with formatter

Comments

@notJoon
Copy link
Member

notJoon commented Sep 3, 2024

Currently, when linting is executed, the results only show the problematic line or area. The issue is that when only the line is displayed, it is difficult to convey to the user what exactly wrong, as the surrounging context is excluded.

Therefore, it would be nice to formatting the problematic line along with its surrounding context to clarify the issue more precisely.

Example

Current

error: return-in-defer
 --> defer2.gno
  |
6 |                return
  |                 ~~~~~~~
  | Avoid using return statement inside a defer function

Updated

error: return-in-defer
 --> defer2.gno
  |
4 |             defer func() {            // <- prior context
5 |                ...                    // <- omit the unrelated part
6 |                return                 // <- main problematic line
  |                ~~~~~~~
  | Avoid using return statement inside a defer function
@notJoon notJoon added T-format Type: related with formatter good first issue Good for newcomers labels Sep 3, 2024
@notJoon notJoon added A-lint Adding new lints AST Require: working with AST or static analysis and removed good first issue Good for newcomers labels Sep 29, 2024
@notJoon notJoon self-assigned this Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Adding new lints AST Require: working with AST or static analysis T-format Type: related with formatter
Projects
None yet
Development

No branches or pull requests

1 participant