A Go linter that enforces consistent whitespace and empty line usage to improve code readability.
wsl is a Go linter that enforces whitespace and empty line rules to improve code readability. It checks for proper spacing between different code constructs like assignments, control structures, and error handling, encouraging developers to use empty lines to separate logical groupings.
Go developers and teams who want to enforce consistent code formatting standards and improve code readability through whitespace rules.
Unlike general formatters, wsl provides granular control over whitespace rules with 20+ configurable checks and automatic fixing capabilities, making it ideal for teams with specific code style preferences.
␊ whitespace linter - Forces you to use empty lines!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
With over 20 checks that can be individually enabled or disabled, teams can precisely tailor whitespace rules to their code style, as shown in the exhaustive check list.
The built-in fixer corrects most whitespace issues using the --fix flag, reducing manual cleanup effort, which is highlighted in the usage notes.
Built on Go's analysis package, it operates at the package level and integrates with golangci-lint as wsl_v5, making it easy to adopt in existing workflows.
The default 'err' check ensures error checking follows immediately after error variable assignment, improving code flow readability as per the philosophy.
Version 5 introduced breaking changes, requiring updates like renaming to wsl_v5 in golangci-lint, which can disrupt tooling and cause migration issues.
The numerous checks and settings, such as 'allow-first-in-block' and 'branch-max-lines', demand significant time to configure properly, potentially overwhelming teams.
As a whitespace-only linter, it must be paired with other tools for comprehensive code quality, adding complexity to the linting setup without covering broader issues.