Skip to content

refactor: Improve code quality throughout the codebase#1642

Merged
anderseknert merged 1 commit intomainfrom
refactor-follow-up
Aug 5, 2025
Merged

refactor: Improve code quality throughout the codebase#1642
anderseknert merged 1 commit intomainfrom
refactor-follow-up

Conversation

@anderseknert
Copy link
Member

This started off as a follow up PR to #1636, but grew somewhat from there :)

  • Move the new file walker to a separate package + improvements
  • Merge logic shared by the lint and fix command. Still more to do here but it's a start
  • Genral improvements in primarily the linter packages

path = strings.TrimPrefix(path, "/")
// handling case for windows when the drive letter is set

// TODO; never set?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! This was meant as a note to you as I haven't worked much on this. It seemed like your intention was to use this, but I take it this isn't needed then?

// handling case for windows when the drive letter is set

// TODO; never set?
var driveLetter string

if matches := drivePatternMaybeEncoded.FindStringSubmatch(path); len(matches) > 1 {
    path = strings.TrimPrefix(path, matches[0])
    path = matches[1] + ":" + strings.TrimPrefix(path, driveLetter)
} else {
    path = "/" + path
}

Should the whole drivePatternMaybeEncoded block be removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah looks like it's not used... unsure why they didn't get caught in the linter?

Copy link
Contributor

@charlieegan3 charlieegan3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

😅

This started off as a follow up PR to #1636, but grew somewhat
from there :):

- Move the new file walker to a separate package + improvements
- Merge logic shared by the lint and fix command. Still more to do here but it's a start.
- Genral improvements in primarily the linter packages

Signed-off-by: Anders Eknert <anders@styra.com>
@anderseknert anderseknert merged commit 65351f9 into main Aug 5, 2025
6 checks passed
@anderseknert anderseknert deleted the refactor-follow-up branch August 5, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants