Skip to main content

classify

Function classify 

Source
pub fn classify(entry: &Path) -> Class
Expand description

Which class entry falls in, judged only from its path, which must be relative to the work tree root.

Relative because the components are searched for node_modules, and an absolute path drags in the components of the root itself: a checkout that happens to live under a directory of that name would otherwise classify every entry in it as vendored.

vendor is any path with a node_modules component rather than only an entry that is one. The broader reading matters because git hands back whatever it did not collapse: a node_modules holding one tracked file arrives as its individual children, and each of those is still a vendored file. Being broad here can only ever keep more, which is the direction the default already leans.

env is the design’s *.env* against the final component, which is contains(".env"). It catches .env, .env.local and prod.env, and does not catch environment.

This judges the entry and nothing else. What an entry hides is [conceals], and both are needed — see select.