feat: Overhaul CLI, add extensive testing, and improve safety#1
Merged
feat: Overhaul CLI, add extensive testing, and improve safety#1
Conversation
This commit introduces a major refactor of the `dontrm` CLI, adding comprehensive unit and E2E tests to ensure correctness and safety. Key changes: - Refactored `main.go` to be more modular and testable. - Added a full unit test suite in `main_test.go` with Docker-based safety checks. - Introduced E2E tests (`e2e_test.sh`) to validate the compiled binary in real-world scenarios. - Created extensive documentation (README, TESTING.md, CONTRIBUTING.md, SECURITY.md). - Added CI/CD workflows for automated testing and releases. - Implemented a `justfile` for streamlined development tasks. The new test suites cover dangerous path detection, glob expansion, CLI arguments, and multi-shell compatibility, significantly improving the project's reliability. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
Updates the version of golangci-lint to v1.63.4 and adds a Go setup step to the e2e test job. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
The version of golangci-lint was outdated. This change upgrades it to v2.5.0. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
Removes the `gofmt` and `gofumpt` linters and adds new allowed commands to the claude settings. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
Removes the goimports linter from the configuration. This linter is now redundant as its functionality is covered by other tools in the CI pipeline. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
- Add a `lint-ci` command to the justfile to run linting with a specific version of golangci-lint in Docker, ensuring consistent linting across environments. - Update the `.golangci.yml` configuration to remove the `gosimple` and `stylecheck` linters, simplifying the linting ruleset. - Remove several `nolint:errcheck` directives from `main.go` and `main_test.go`, improving code clarity and ensuring proper error handling is considered. - Update `.claude/settings.local.json` to allow new `just` commands. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
This commit introduces a new Dockerfile specifically for running tests in a containerized environment. This will help ensure that tests are run in a consistent and reproducible manner. The .gitignore file has been updated to ensure that this new Dockerfile is not ignored. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
The -race flag is removed from the `go test` command in the CI workflow to prevent flaky tests. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
just test)just e2e)just coverage)just lint)💘 Generated with Crush