Skip to content

refactor: reduce run complexity and add Makefile#17

Merged
mlorentedev merged 3 commits into
masterfrom
fix/lint-and-complexity
Mar 10, 2026
Merged

refactor: reduce run complexity and add Makefile#17
mlorentedev merged 3 commits into
masterfrom
fix/lint-and-complexity

Conversation

@mlorentedev
Copy link
Copy Markdown
Owner

Summary

  • Extract initTailscale(), handleShutdown(), and drainActiveConnections() from run(), reducing cyclomatic complexity from 19 to 7 (threshold: 15)
  • Add Makefile with standard dev targets: build, test, lint, security, shellcheck, check, cover, clean

Test plan

  • make test passes (all tests green with -race)
  • make build produces binary
  • make shellcheck clean
  • go vet ./... clean

## Summary

- Extract initTailscale, handleShutdown, and drainActiveConnections from the run function
- Reduce cyclomatic complexity of run function from 19 to 7
- Improve readability and maintainability of the main entry point
Unified local entry point for build, test, lint, security, shellcheck,
cover and check (all-in-one). Aligns with CI pipeline targets.
@mlorentedev mlorentedev merged commit 5da90b3 into master Mar 10, 2026
11 checks passed
@mlorentedev mlorentedev deleted the fix/lint-and-complexity branch March 10, 2026 03:33
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.

1 participant