Skip to content

Commit 1db091c

Browse files
mathausekeewis
andauthored
document empty overrides, exclude and ignored_validations (#33)
* document optional `overrides`, `exclude` and `ignored_validations` * add test * Apply suggestions from code review Co-authored-by: Justus Magin <[email protected]> --------- Co-authored-by: Justus Magin <[email protected]>
1 parent 9cb4647 commit 1db091c

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,20 @@ jobs:
5050
envs/env1.yaml
5151
envs/env2.yaml
5252
expected-failure: ["false"]
53+
policy-file: ["policy.yaml"]
5354
include:
5455
- env-paths: |
5556
envs/failing-env1.yaml
57+
policy-file: "policy.yaml"
5658
expected-failure: "true"
5759
- env-paths: |
5860
envs/env1.yaml
5961
envs/failing-env1.yaml
62+
policy-file: "policy.yaml"
6063
expected-failure: "true"
64+
- env-paths: "envs/env1.yaml"
65+
policy-file: policy_no_extra_options.yaml
66+
expected-failure: "false"
6167

6268
steps:
6369
- name: clone the repository
@@ -67,7 +73,7 @@ jobs:
6773
id: action-run
6874
continue-on-error: true
6975
with:
70-
policy: policy.yaml
76+
policy: ${{ matrix.policy-file }}
7177
environment-paths: ${{ matrix.env-paths }}
7278
today: 2024-12-20
7379
- name: detect outcome

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ policy:
3232
- package4
3333
```
3434
35-
then add a new step to CI:
35+
If there are no packages with `overrides`, `exclude`, or `ignored_violations`, you can set
36+
them to an empty mapping or sequence, respectively:
37+
38+
```yaml
39+
...
40+
overrides: {}
41+
exclude: []
42+
ignored_violations: []
43+
```
44+
45+
Then add a new step to CI:
3646

3747
```yaml
3848
jobs:

policy_no_extra_options.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
channels:
2+
- conda-forge
3+
platforms:
4+
- noarch
5+
- linux-64
6+
policy:
7+
# all packages in months
8+
packages:
9+
python: 30
10+
numpy: 18
11+
default: 12
12+
overrides: {}
13+
exclude: []
14+
ignored_violations: []

0 commit comments

Comments
 (0)