Skip to content

Conversation

@emanueleaina
Copy link

I had a script in ~/bin and when opening it sleuth was picking an unrelated .sh in my home. If I had an unrelated .sh in ~/bin itself this patch would not be helpful at all, but blacklisting $HOME and / seemed a sensible thing anyway as they likely contain a collection of files from different origins that do not provide any useful insight.

The user home dir and the root dir likely contain a collection of files
from different origins that do not provide any useful insight.
sheerun added a commit to sheerun/vim-polyglot that referenced this pull request Sep 4, 2020
Repository owner deleted a comment from sheerun Dec 11, 2021
@tpope
Copy link
Owner

tpope commented Dec 19, 2021

Lots of directories are collections of unrelated files. I don't think $HOME is worth singling out. In fact, I'd go so far as to say $HOME is a better directory to check than your average hodgepodge, as most of what's in there is dot files, which are related by way of creator, and are a good source of user defaults. The README even calls this out:

  • Searching for other files of the same type continues up the directory
    hierarchy until a match is found. This means, for example, the indent for
    the first file in a brand new Ruby project might very well be derived from
    your .irbrc. I consider this a feature.

In practice I haven't found this to be as useful in practice as I hoped, and I will likely be making this less aggressive in the near future (and perhaps more configurable to boot), but a blanket default ban on $HOME (or the typically barren /) isn't in the cards.

To address your specific problem, 2 workarounds are now available:

  • Add a modeline to the script you're editing.
  • echo 'root = true' > ~/bin/.editorconfig.

@tpope tpope closed this Dec 19, 2021
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