-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor, fix(nolint): Enhance Inline Detection (#128)
# Description Improve `nolint` comment scope detection and inline comment handling. **Key changes:** 1. Enhanced inline comment detection - Updated `isInlineComment` function to determine inline status based on file offsets - A comment is considered inline if it appears after a statement on the same line - Example: In `fmt.Println("foo") //nolint:rule1`, the comment is properly detected as inline since it follows the statement 2. Refined scope determination rules - For standalone comments (without code), the scope extends from the comment line through the end of the next statement - Comments appearing before the package declaration now apply to the entire file 3. Refactored - Changed some type and variable names
- Loading branch information
Showing
2 changed files
with
63 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters