1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! Whether a project has opted into a tool, by the configuration files its spec names.
use Path;
use crateToolSpec;
/// Whether the project has opted into this tool.
///
/// "Style adherence where defined": a repo with no eslint config has not
/// chosen eslint's defaults, so running it would invent findings the
/// project never asked for.
/// Which of `config_files` is present in `root`, in declaration order.
///
/// One definition of "which config file is here", because two callers need
/// the answer and they need slightly different halves of it: eligibility
/// wants only whether there was one, while `config_flag` has to pass the
/// *name* to a tool that will not look for its own. The flag branch used to
/// ask separately with a bare `join(name).exists()`, which does not
/// understand the leading `*.` glob `marker_match` accepts - so a spec
/// pairing a glob marker with a flag would be judged configured and then run
/// without the flag it needs. Only the pairing of tools kept that dormant:
/// `dotnet format` already has glob markers and checkstyle already has a
/// flag.
///
/// The list reads as a preference rather than as whatever the filesystem
/// returns, so the first declared match wins.
pub
/// The marker `name` claims in `root`, as the name of the file found.
///
/// A `*.ext` entry matches any file in the directory carrying that extension.
/// C# is the first language whose workspace is identified by a glob rather
/// than a fixed name: MSBuild has to run from the directory holding the
/// `.csproj` or `.sln`, and those are named after the project. Keying
/// `dotnet format` on `.editorconfig` instead - the file it reads its rules
/// from - picks whichever ancestor happens to hold one, which in a solution
/// laid out with projects in subdirectories is a directory with no project in
/// it at all, where MSBuild exits with "Could not find a project or solution
/// file" and drep reports a configured tool that could not run.
///
/// Only a leading `*.` is a glob. A name is otherwise taken literally, so
/// `.eslintrc.json` and the rest keep costing one `exists` rather than a
/// directory read.
/// Whether `path` is what the marker `name` names in `workspace`: a `*.ext` marker any file directly in `workspace` with that extension, whatever its case, and any other marker the one path it spells there.
pub