-
Notifications
You must be signed in to change notification settings - Fork 2
Ft Add Sym Link Following #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
biasedbit
merged 55 commits into
holonoms:main
from
TWDickson:ft/Add-Sym-Link-Following
Jul 20, 2025
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
ee5b1dd
chore(deps): bump golang.org/x/crypto from 0.21.0 to 0.31.0 (#1)
dependabot[bot] edd5fda
chore: update README.md
biasedbit ff57bda
chore: update .sandwormignore
biasedbit 9e825ef
chore: update CHANGELOG
biasedbit 206d768
feat: setup goreleaser to update brew formula
biasedbit 72a7f8a
fix: release env var
biasedbit 4f4fb4c
fix: update goreleaser
biasedbit f0ef126
chore: update README with install instructions
biasedbit e5656a9
fix: remove unnecessary go dependency
biasedbit 23ed3be
fix: brew test command
biasedbit 270d4e5
fix: special handling for when Claude is in the strugglebus
biasedbit 49e322a
chore: update README
biasedbit 9743f5e
fix: support target folder for default command
biasedbit f7dbdcd
chore: reuse newPushCmd code
biasedbit 9882534
chore: update CHANGELOG
biasedbit ff2d9e9
fix(CWE-770,CWE-440): bump golang.org/x/net
biasedbit 9ddefe5
feat: global configuration support
fredoliveira 927abc9
chore: resolved goreleaser deprecation warning
fredoliveira 2666719
chore(deps): bump github.com/go-git/go-git/v5 from 5.12.0 to 5.13.0 (#3)
dependabot[bot] 86cec6e
chore(deps): bump golang.org/x/net from 0.33.0 to 0.38.0 (#5)
dependabot[bot] 26db2ca
chore: swap .tool-version with mise.toml
biasedbit 8087201
chore: add -dev suffix to installed dev binary
biasedbit 5e90d9d
chore: add just task to update project deps
biasedbit 092e499
chore: bump deps
biasedbit 257287e
chore: update linter config and code to match
biasedbit d8c1f9c
fix: adjust base url
biasedbit c27c1ed
cosmetic: modernize interface{} to any
biasedbit 68236a8
chore: align go.mod go version with mise.toml
biasedbit 00ea619
chore: instal to $GOBIN rather than $GOPATH/bin
biasedbit 945a108
chore: update CI workflows
biasedbit 04b7a16
chore: update CHANGELOG
biasedbit db24785
feat(Pathing): Add Windows Pathing Compatibility
TWDickson 675d05c
chore: bump golang to 1.24.5 & bump all deps
biasedbit ea3db4a
fix: use gh action to setup just
biasedbit 908fcc7
fix: lock CI package versions to match mise.toml
biasedbit 9ebaaf4
refactor: lift CLI logic to its own package
biasedbit b4db028
Optionally add line numbers to output (#8)
biasedbit f51aff2
chore: prep 0.2.0 release
biasedbit 8f941a7
feat(Pathing): :sparkles: Add Windows Pathing Compatibility
TWDickson 9dc6c41
fix(Pathing): :bug: Remove filepath.ToSlash in favour of splitting wi…
TWDickson 7f3dfc2
feat(Pathing): :heavy_plus_sign: Add GoDirWalk Dependency
TWDickson b8c920e
feat(Pathing): :sparkles: Add configuration management commands and f…
TWDickson a79da90
feat(Pathing): :sparkles: Add skeleton support for following symbolic…
TWDickson 4ae9466
feat(Pathing): :sparkles: Set Processor Symlink Handling in Main
TWDickson 5653f4f
feat(Pathing): :sparkles: Use GoDirWalk in Processor.collectFiles for…
TWDickson 2b14848
test(Pathing): :white_check_mark: Add SymLink Processor Tests
TWDickson 1714375
docs(Pathing): :memo: Update Readme for new sym link config
TWDickson c23f4d8
chore(GitIgnore): :see_no_evil: Add .VSCode to gitignore
TWDickson c2bea0a
refactor: :twisted_rightwards_arrows: Rebase on Master: Further Work …
TWDickson 7b75ee8
refactor(Config): :fire: Remove Old Config File
TWDickson 9792643
feat: :sparkles: Update Sym Link Following, Fix Missing Code from Merge
TWDickson 52f449b
feat: :sparkles: Enhance CLI Options Handling and Add Tests for Gener…
TWDickson 4985d9c
docs: :memo: Update Readme for Line Number Flag
TWDickson 3da8acd
chore: Resolve Conflicts and update go.mod and go.sum
TWDickson 52602c5
fix: :rotating_light: Fix Linter Warnings from CI Build
TWDickson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,6 @@ go.work | |
| # Sandworm specific | ||
| .sandworm | ||
| .sandworm*.txt | ||
|
|
||
| # VSCode | ||
| .vscode/ | ||
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| package cli | ||
|
|
||
| import ( | ||
| "os" | ||
| "path/filepath" | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestGenerateCmd_Flags(t *testing.T) { | ||
| tmpDir, err := os.MkdirTemp("", "sandworm-cli-test-*") | ||
| if err != nil { | ||
| t.Fatalf("Failed to create temp dir: %v", err) | ||
| } | ||
| defer os.RemoveAll(tmpDir) | ||
|
|
||
| opts := &Options{} | ||
| rootCmd := NewRootCmd(opts) | ||
| rootCmd.SetArgs([]string{"generate", tmpDir, "--line-numbers", "--follow-symlinks"}) | ||
| err = rootCmd.Execute() | ||
| if err != nil { | ||
| t.Fatalf("Command failed: %v", err) | ||
| } | ||
|
|
||
| if opts.ShowLineNumbers == nil || !*opts.ShowLineNumbers { | ||
| t.Errorf("Expected ShowLineNumbers to be true, got %v", opts.ShowLineNumbers) | ||
| } | ||
| if opts.FollowSymlinks == nil || !*opts.FollowSymlinks { | ||
| t.Errorf("Expected FollowSymlinks to be true, got %v", opts.FollowSymlinks) | ||
| } | ||
| if opts.Directory != tmpDir { | ||
| t.Errorf("Expected Directory to be '%v', got %v", tmpDir, opts.Directory) | ||
| } | ||
|
|
||
| // Clean up generated output file | ||
| os.Remove("sandworm.txt") | ||
| } | ||
|
|
||
| func TestGenerateCmd_FlagsOverrideConfig(t *testing.T) { | ||
| tmpDir, err := os.MkdirTemp("", "sandworm-cli-test-*") | ||
| if err != nil { | ||
| t.Fatalf("Failed to create temp dir: %v", err) | ||
| } | ||
| defer os.RemoveAll(tmpDir) | ||
|
|
||
| opts := &Options{} | ||
| rootCmd := NewRootCmd(opts) | ||
| rootCmd.SetArgs([]string{"generate", tmpDir, "--line-numbers=false", "--follow-symlinks=false"}) | ||
| err = rootCmd.Execute() | ||
| if err != nil { | ||
| t.Fatalf("Command failed: %v", err) | ||
| } | ||
|
|
||
| if opts.ShowLineNumbers == nil || *opts.ShowLineNumbers { | ||
| t.Errorf("Expected ShowLineNumbers to be false, got %v", opts.ShowLineNumbers) | ||
| } | ||
| if opts.FollowSymlinks == nil || *opts.FollowSymlinks { | ||
| t.Errorf("Expected FollowSymlinks to be false, got %v", opts.FollowSymlinks) | ||
| } | ||
|
|
||
| // Clean up generated output file | ||
| os.Remove("sandworm.txt") | ||
| } | ||
|
|
||
| func TestGenerateCmd_OutputIgnoreKeepFlags(t *testing.T) { | ||
| tmpDir, err := os.MkdirTemp("", "sandworm-cli-test-*") | ||
| if err != nil { | ||
| t.Fatalf("Failed to create temp dir: %v", err) | ||
| } | ||
| defer os.RemoveAll(tmpDir) | ||
|
|
||
| outputFile := "myoutput.txt" | ||
| ignoreFile := "myignore.txt" | ||
| ignorePath := filepath.Join(tmpDir, ignoreFile) | ||
| if err := os.WriteFile(ignorePath, []byte("*.tmp\n"), 0o644); err != nil { | ||
| t.Fatalf("Failed to create dummy ignore file: %v", err) | ||
| } | ||
|
|
||
| opts := &Options{} | ||
| rootCmd := NewRootCmd(opts) | ||
| rootCmd.SetArgs([]string{"generate", tmpDir, "--output", outputFile, "--ignore", ignorePath, "--keep"}) | ||
| if err := rootCmd.Execute(); err != nil { | ||
| t.Fatalf("Command failed: %v", err) | ||
| } | ||
| // Clean up generated output file | ||
| os.Remove(outputFile) | ||
|
|
||
| if opts.OutputFile != outputFile { | ||
| t.Errorf("Expected OutputFile to be '%v', got '%v'", outputFile, opts.OutputFile) | ||
| } | ||
| if opts.IgnoreFile != ignorePath { | ||
| t.Errorf("Expected IgnoreFile to be '%v', got '%v'", ignorePath, opts.IgnoreFile) | ||
| } | ||
| if !opts.KeepFile { | ||
| t.Errorf("Expected KeepFile to be true, got %v", opts.KeepFile) | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌