You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(RepositoryConfiguration): Add a model for path includes
Add model classes for path includes. Path includes can be used to mark
files matched by a glob pattern as included.
Signed-off-by: Nicolas Nobelis <[email protected]>
Copy file name to clipboardExpand all lines: website/docs/configuration/ort-yml.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ The items below can be configured by adding an `.ort.yml` file to the root of th
4
4
All configurations in this file apply only to this Project's context.
5
5
Usually, the global context is preferred for an increased degree of automation, and local configurations should only be done if there are good reasons.
6
6
7
+
*[includes](#includes) - Mark [files, directories](#including-paths) as included in released artifacts.
7
8
*[excludes](#excludes) - Mark [files, directories](#excluding-paths) or [package manager scopes](#excluding-scopes) as not included in released artifacts.
8
9
*[resolutions](#resolutions) - Resolve any issues or policy rule violations.
9
10
*[curations](#curations) - Overwrite package metadata, set a concluded license, or correct license findings in the project.
@@ -14,6 +15,60 @@ The sections below explain each in further detail.
14
15
Prefer to learn by example?
15
16
See the [.ort.yml](https://github.com/oss-review-toolkit/ort/blob/main/.ort.yml) for the OSS Review Toolkit itself.
16
17
18
+
## Includes
19
+
20
+
### When to Use Includes
21
+
22
+
Includes are used to define which OSS is distributed to third parties and which code is only used internally.
23
+
24
+
Inclusions apply to paths (files/directories) only.
25
+
Examples of currently supported inclusions:
26
+
27
+
* all dependencies defined in `./src/pom.xml` in Maven-based projects.
28
+
29
+
### Includes Basics
30
+
31
+
ORT's default philosophy is to analyze and scan everything it can find to build a complete picture of a repository and its dependencies.
32
+
33
+
However, in some cases, only a subset of the repository is relevant for the analysis, for example, if the repository is a monorepo containing multiple projects.
34
+
While [excludes](#excludes) could be used to ignore the irrelevant parts, it is often more convenient to explicitly include only the relevant parts.
35
+
36
+
To be able to show why a part is included, each include must have an explanation.
37
+
The explanation consists of:
38
+
39
+
*`reason` -- must be selected from a predefined list of options.
40
+
*`comment` -- free text that provides an optional explanation.
41
+
42
+
### Including Paths
43
+
44
+
Path includes are used to mark a complete path as included.
45
+
46
+
The code below shows the structure of a path include in the `.ort.yml` file:
47
+
48
+
```yaml
49
+
includes:
50
+
paths:
51
+
- pattern: "A glob pattern matching files or paths."
52
+
reason: "One of PathIncludeReason e.g. SOURCE_OF."
53
+
comment: "A comment further explaining why the path is included."
54
+
```
55
+
56
+
Where the list of available options for `reason` is defined in [PathIncludeReason.kt](https://github.com/oss-review-toolkit/ort/blob/main/model/src/main/kotlin/config/PathIncludeReason.kt).
57
+
For how to write a glob pattern, please see the [AntPathMatcher documentation](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html).
58
+
59
+
The path include below has the following effects:
60
+
61
+
* All projects found below the `src` directory are marked as included.
62
+
* License findings in files below the `src` directory are marked as included.
63
+
64
+
```yaml
65
+
excludes:
66
+
paths:
67
+
- pattern: "src/**"
68
+
reason: "SOURCE_OF"
69
+
comment: "This directory contains the source code of binaries that are distributed."
70
+
```
71
+
17
72
## Excludes
18
73
19
74
### When to Use Excludes
@@ -149,6 +204,14 @@ import Yarn from '!!raw-loader!@site/../examples/yarn.ort.yml'
0 commit comments