Skip to content
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

utils/file: remove usage of find command to search for files #719

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

matheusalcantarazup
Copy link
Contributor

@matheusalcantarazup matheusalcantarazup commented Oct 26, 2021

Previously some functions of utils/file package use the command find
to search for files, which make only Linux compatible and add an
unnecessary dependency. This commit change the implementation to use
filepath.Walk function and search using only the Go std.

This commit also make some improvements on function names, remove
dead code and add some documentation.

Also this commit change some usages of ReplacePathSeparator to use
filepath.Join instead which is a better approach since this package is
OS compatible. Note that not all usages of ReplacePathSeparator was
changed since in some cases we need to replace slashes on paths that
was returned from tools that run on Docker when we are running on
Windows.

Signed-off-by: Matheus Alcantara [email protected]

- What I did

- How to verify it

- Description for the changelog

iancardosozup added a commit that referenced this pull request Oct 26, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
Previously some functions of utils/file package use the command find
to search for files, which make only Linux compatible and add an
unnecessary dependency. This commit change the implementation to use
filepath.Walk function and search using only the Go std.

This commit also make some improvements on function names, remove
dead code and add some documentation.

Also this commit change some usages of ReplacePathSeparator to use
filepath.Join instead which is a better approach since this package is
OS compatible. Note that not all usages of ReplacePathSeparator was
changed since in some cases we need to replace slashes on paths that
was returned from tools that run on Docker when we are running on
Windows.

Signed-off-by: Matheus Alcantara <[email protected]>
@matheusalcantarazup matheusalcantarazup merged commit 6f1e577 into main Oct 27, 2021
@matheusalcantarazup matheusalcantarazup deleted the improvement-file-pkg branch October 27, 2021 12:54
iancardosozup added a commit that referenced this pull request Oct 27, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Oct 28, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Oct 28, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Oct 28, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Oct 28, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Oct 28, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Oct 28, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
iancardosozup added a commit that referenced this pull request Nov 3, 2021
this commits updates language detect tests and some file matching checks now using filepath.Join(), removing ReplacePathSeparator usages on this package as discussed in #719 and fix to_ignore paths to run as it should

Signed-off-by: Ian Cardoso <[email protected]>
matheusalcantarazup pushed a commit that referenced this pull request Nov 3, 2021
…ths (#720)

This commits updates language detect tests and some file matching 
checks now using filepath.Join(), removing ReplacePathSeparator
usages on this package as discussed in #719 and fix to_ignore paths 
to run as it should.

Signed-off-by: Ian Cardoso <[email protected]>
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.

4 participants