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

feat: ignore dot directories and files #337

Merged
merged 3 commits into from
May 6, 2022
Merged

Conversation

i4ki
Copy link
Contributor

@i4ki i4ki commented May 5, 2022

No description provided.

@i4ki i4ki requested a review from katcipis May 5, 2022 01:04
@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #337 (0eb73f5) into main (c3b4925) will decrease coverage by 0.16%.
The diff coverage is 26.31%.

@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
- Coverage   68.33%   68.16%   -0.17%     
==========================================
  Files          35       35              
  Lines        6594     6613      +19     
==========================================
+ Hits         4506     4508       +2     
- Misses       1836     1848      +12     
- Partials      252      257       +5     
Flag Coverage Δ
tests 68.16% <26.31%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
hcl/hcl.go 85.41% <0.00%> (-0.34%) ⬇️
init.go 39.47% <0.00%> (-1.63%) ⬇️
list.go 84.21% <0.00%> (-7.22%) ⬇️
manager.go 63.10% <0.00%> (-0.31%) ⬇️
stack/loader.go 54.00% <62.50%> (-1.64%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3b4925...0eb73f5. Read the comment docs.

@i4ki i4ki requested a review from mariux May 5, 2022 21:23
@@ -51,6 +51,15 @@ func TestStacksInit(t *testing.T) {
layout: []string{"s:stack"},
input: []string{"stack"},
},
{
name: "dot directories are not allowed",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we disallow terramate init .stack

@@ -49,6 +50,10 @@ func ListStacks(root string) ([]Entry, error) {
return filepath.SkipDir
}

if strings.HasPrefix(info.Name(), ".") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extreme feeling of we needing our fs interface + having a generalization that builds a fs interface that doesnt list dot dirs/files on top

Copy link
Contributor

@katcipis katcipis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM + non blocking comments

Comment on lines 168 to 170
if strings.HasSuffix(path, "/.git") {
return filepath.SkipDir
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the .git logic to skip the dir anymore, it skips all dotdirs

@katcipis katcipis merged commit 045d940 into main May 6, 2022
@katcipis katcipis deleted the i4k-ignore-dot-files-and-dirs branch May 6, 2022 15:29
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.

2 participants