Add home directory to config file search paths#1325
Conversation
|
Hey, thank you for opening your first Pull Request ! |
|
So, dumb question, but I must ask it: have you test it on your env? Since we cannot write the unit test for this. And I cannot test it on my laptop, I don't have external adds or usb sticks |
|
I have tested it but have not written automated tests for it. From another drive ( With v1.30.0:
You can notice the additional linters I enabled are correctly enabled. |
|
Cool, thanks |
|
So, we leave it like that and write no tests? |
|
Another question just to be sure since I haven't dug into the code, is the search order like this now so Given code in /mnt/path/go |
|
We can write the test, but it will require some refactoring. |
|
it will work in this order:
the |
|
@bombsimon The home directory is added last, so it should be checked last. However, there is a possibility for duplicate paths (effectively checking the same path twice). I can add a check to prevent this if needed. Proof: @SVilgelm I am still a bit lost on how I could write those tests. Maybe it can be merged and tests added later by the core team? |
|
Duplicate paths fixed: |
| } | ||
| } | ||
|
|
||
| func sliceContains(slice []string, value string) bool { |
There was a problem hiding this comment.
I can't find where this function is used.
There was a problem hiding this comment.
There was a problem hiding this comment.
I think it would be better to move to slice utils or so, so we can reuse it later
There was a problem hiding this comment.
it's needed to avoid duplications in the list of folders
There was a problem hiding this comment.
Should I create a new package pkg/sliceutil and put it there?
There was a problem hiding this comment.
yeah, it would be better if you move it to pkg/sliceutil
|
Hey, @System-Glitch — we just merged your PR to
By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests. Thanks again! |
See #1324
Guidance required: tests don't pass if you have a configuration file in your home directory. This is because some tests check that config is not found. I need assistance on how to update tests properly.