handle symlinks in a semi dry manner#647
handle symlinks in a semi dry manner#647james-powis wants to merge 1 commit intoadrienverge:masterfrom
Conversation
e80194d to
fe91e44
Compare
|
This pull request is not reviewable as is: function-local code style not respected, quotes, inclusion of But I understand that it's intended, and you want to start a discussion about symbolic links.
I don't think all yamllint users would agree, this would be a breaking change. |
|
The goal of this PR was not to actually get this accepted, it was to demonstrate one of the few problems symlinks present. Especially around excluding... Do you apply exclude the symlink or the target, or both, none? How do you handle the reporting of the lint issue, do you report the link, or the target?. How do you prevent 100 million symlinks to the same file not result in the running of yamllint 100 million times. Ultimately, if the file should be linted, it should be linted at the source not the one of potentially numerous links to it. By excluding the symlink entirely, the users of yamllint have the option to target the target via include if so desired file. But that is just my opinion. |
fe91e44 to
ce64fc2
Compare
The Goal of this PR is to incorporate a fairly clean way to handle symlinks.
Symlinks are exceptionally problematic, because:
This solution aims to:
This solution falls flat to be a good solution because:
yieldwithset()is memory inefficient.My hope with this MR is to start a discussion about how best to handle symlinks. And my current recommendation is to skip them entirely. Leave it up to the user to target the FILES they want linted specifically.