-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Make paths and fingerprints platform-agnostic #1622
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
Make paths and fingerprints platform-agnostic #1622
Conversation
697b436
to
59a5e12
Compare
59a5e12
to
b074b3f
Compare
I ran this on windows and as far as I could tell, it works well. The unit test TestFromFiles now also passes on windows. (some other unit tests still fail on windows for reasons entirely unrelated to this pull request, e.g. symlinks and deletion of temp files) |
b074b3f
to
498034f
Compare
082fc96
to
4053c9a
Compare
710104b
to
6fbc170
Compare
4d1dac7
to
9d3555e
Compare
9d3555e
to
c206912
Compare
@zricethezav it's a bit awkward but I believe this is now fully backwards-compatible.
|
a574ad7
to
260f42d
Compare
260f42d
to
ef7216f
Compare
ef7216f
to
5c71c5b
Compare
@@ -49,6 +49,7 @@ func TestWriteSarif(t *testing.T) { | |||
t.Run(test.cfgName, func(t *testing.T) { | |||
tmpfile, err := os.Create(filepath.Join(t.TempDir(), test.testReportName+".json")) | |||
require.NoError(t, err) | |||
defer tmpfile.Close() |
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.
whoops, thanks for adding this in
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.
Surprisingly, this didn't seem to cause trouble on *nix. It was only a consistent issue on Windows.
this change also fixes, or skips, windows failures
5c71c5b
to
0a4ef20
Compare
great work! |
* test: windows * fix: make paths platform-agnostic this change also fixes, or skips, windows failures
Description:
This fixes #1565.
Note: the current 'fix' is technically a breaking change forpath
/paths
regular expressions as mentioned here. I don't know if this is acceptable, or what the best way to handle this would be. (Test both styles of paths ifruntime.GOOS == 'Windows'
?)TODO
rule.path
andrule.allowlist.paths
regexes on WindowsChecklist: