Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
9259d2f to
51e375c
Compare
e9739d6 to
8a5fefb
Compare
| // Override the function to find rules.yaml to use our test file | ||
| originalRulesFilePath := filepath.Join("plugins", "tools", "semgrep", "rules.yaml") |
There was a problem hiding this comment.
this change is related to the fact that semgrep config could not be created in subdirs with init cuz it could not find rules.yaml before
| // Get the default rules file location | ||
| rulesFile := filepath.Join("plugins", "tools", "semgrep", "rules.yaml") | ||
| // Get the executable's directory | ||
| execPath, err := getExecutablePath() |
There was a problem hiding this comment.
Don't love us messing with executable path. Don't we have a workdir or something that we can add and have on the config?
Maybe the problem here is more related to something that is not correctly embeded? I think I saw some change on some PR of @andrzej-janczak that he actually needed to update a Join that would not work on windows, and needed to make '/'. Maybe he has any input here?
There was a problem hiding this comment.
hm, we can test but should work theoretically
filepath.Join is specifically designed to be cross-platform:
On Windows, it uses backslashes ()
On Unix-like systems, it uses forward slashes (/)
It handles the path separator differences automatically
os.Executable() is also cross-platform:
Returns the correct path format for the OS
On Windows, it returns paths with backslashes
On Unix, it returns paths with forward slashes
os.Stat and os.ReadFile are also cross-platform and handle path separators correctly.
There was a problem hiding this comment.
we tested this on both Windows native and WSL and both are working ok
No description provided.