Skip to content

Commit a6da814

Browse files
authored
Merge pull request matplotlib#27698 from QuLogic/yaml-lint
Add linting and validation of all YAML files
2 parents dcd1d23 + 81709d4 commit a6da814

36 files changed

+4914
-343
lines changed

.appveyor.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/
33
# https://packaging.python.org/en/latest/appveyor/
44
# https://github.com/rmcgibbo/python-appveyor-conda-example
5+
---
56

67
# Backslashes in quotes need to be escaped: \ -> "\\"
78
branches:
@@ -38,7 +39,7 @@ environment:
3839
# We always use a 64-bit machine, but can build x86 distributions
3940
# with the PYTHON_ARCH variable
4041
platform:
41-
- x64
42+
- x64
4243

4344
# all our python builds have to happen in tests_script...
4445
build: false
@@ -79,18 +80,21 @@ test_script:
7980
- if x%TEST_ALL% == xyes conda install -q ffmpeg inkscape miktex
8081
# missing packages on conda-forge for imagemagick
8182
# This install sometimes failed randomly :-(
82-
#- choco install imagemagick
83+
# - choco install imagemagick
8384

8485
# Test import of tkagg backend
85-
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
86+
- python -c
87+
"import matplotlib as m; m.use('tkagg');
88+
import matplotlib.pyplot as plt;
89+
print(plt.get_backend())"
8690
# tests
8791
- echo The following args are passed to pytest %PYTEST_ARGS%
8892
- pytest %PYTEST_ARGS%
8993

9094
artifacts:
9195
- path: result_images\*
9296
name: result_images
93-
type: zip
97+
type: Zip
9498

9599
on_finish:
96100
- conda install codecov

.circleci/config.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ commands:
1717
export git_log=$(git log --max-count=1 --pretty=format:"%B" | tr "\n" " ")
1818
echo "Got commit message:"
1919
echo "${git_log}"
20-
if [[ -v CIRCLE_PULL_REQUEST ]] && [[ $git_log =~ (\[skip circle\]|\[circle skip\]|\[skip doc\]|\[doc skip\]) ]]; then
20+
if [[ -v CIRCLE_PULL_REQUEST ]] &&
21+
[[ $git_log =~ (\[skip circle\]|\[circle skip\]|\[skip doc\]|\[doc skip\]) ]]; then
2122
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
2223
circleci-agent step halt;
2324
fi
@@ -71,8 +72,12 @@ commands:
7172
name: Install custom fonts
7273
command: |
7374
mkdir -p ~/.local/share/fonts
74-
wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true
75-
wget -nc https://github.com/ipython/xkcd-font/blob/master/xkcd-script/font/xkcd-script.ttf?raw=true -O ~/.local/share/fonts/xkcd-Script.ttf || true
75+
wget -nc \
76+
https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true \
77+
-O ~/.local/share/fonts/Felipa-Regular.ttf || true
78+
wget -nc \
79+
https://github.com/ipython/xkcd-font/blob/master/xkcd-script/font/xkcd-script.ttf?raw=true \
80+
-O ~/.local/share/fonts/xkcd-Script.ttf || true
7681
fc-cache -f -v
7782
- save_cache:
7883
key: fonts-4

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# These are supported funding model platforms
23
github: [matplotlib, numfocus]
34
custom: https://numfocus.org/donate-to-matplotlib

.github/ISSUE_TEMPLATE/bug_report.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Bug Report
23
description: Report a bug or issue with Matplotlib.
34
title: "[Bug]: "
@@ -6,26 +7,24 @@ body:
67
id: summary
78
attributes:
89
label: Bug summary
9-
description: Describe the bug in 1-2 short sentences
10-
placeholder:
11-
value:
10+
description: Describe the bug in 1-2 short sentences
1211
validations:
1312
required: true
1413
- type: textarea
1514
id: reproduction
1615
attributes:
1716
label: Code for reproduction
18-
description: |
17+
description: >-
1918
If possible, please provide a minimum self-contained example.
2019
placeholder: Paste your code here. This field is automatically formatted as Python code.
21-
render: python
20+
render: Python
2221
validations:
2322
required: true
2423
- type: textarea
2524
id: actual
2625
attributes:
2726
label: Actual outcome
28-
description: |
27+
description: >-
2928
Paste the output produced by the code provided above, e.g.
3029
console output, images/videos produced by the code, any relevant screenshots/screencasts, etc.
3130
validations:

.github/ISSUE_TEMPLATE/config.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2-
blank_issues_enabled: true # default
1+
# Reference:
2+
# https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
3+
---
4+
blank_issues_enabled: true # default
35
contact_links:
46
- name: Question/Support/Other
57
url: https://discourse.matplotlib.org

.github/ISSUE_TEMPLATE/documentation.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Documentation
23
description: Create a report to help us improve the documentation
34
title: "[Doc]: "
@@ -7,9 +8,9 @@ body:
78
id: link
89
attributes:
910
label: Documentation Link
10-
description: |
11-
Link to any documentation or examples that you are referencing.
12-
Suggested improvements should be based on the development version of the docs: https://matplotlib.org/devdocs/
11+
description: >-
12+
Link to any documentation or examples that you are referencing. Suggested improvements should be based
13+
on [the development version of the docs](https://matplotlib.org/devdocs/)
1314
placeholder: https://matplotlib.org/devdocs/...
1415
- type: textarea
1516
id: problem

.github/ISSUE_TEMPLATE/feature_request.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
---
12
name: Feature Request
23
description: Suggest something to add to Matplotlib!
34
title: "[ENH]: "
45
labels: [New feature]
56
body:
67
- type: markdown
78
attributes:
8-
value: |
9-
Please search the [issues](https://github.com/matplotlib/matplotlib/issues) for relevant feature requests before creating a new feature request.
9+
value: >-
10+
Please search the [issues](https://github.com/matplotlib/matplotlib/issues) for relevant feature
11+
requests before creating a new feature request.
1012
- type: textarea
1113
id: problem
1214
attributes:

.github/ISSUE_TEMPLATE/maintenance.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Maintenance
23
description: Help improve performance, usability and/or consistency.
34
title: "[MNT]: "
@@ -7,7 +8,7 @@ body:
78
id: summary
89
attributes:
910
label: Summary
10-
description: Please provide 1-2 short sentences that succinctly describes what could be improved.
11+
description: Please provide 1-2 short sentences that succinctly describes what could be improved.
1112
validations:
1213
required: true
1314
- type: textarea

.github/ISSUE_TEMPLATE/tag_proposal.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
---
12
name: Tag Proposal
23
description: Suggest a new tag or subcategory for the gallery of examples
34
title: "[Tag]: "
45
labels: [Tag proposal]
56
body:
67
- type: markdown
78
attributes:
8-
value: |
9-
Please search the [tag glossary]() for relevant tags before creating a new tag proposal.
9+
value: >-
10+
Please search the [tag glossary]() for relevant tags before creating a new tag proposal.
1011
- type: textarea
1112
id: need
1213
attributes:
@@ -23,5 +24,5 @@ body:
2324
id: solution
2425
attributes:
2526
label: Proposed solution
26-
description: >
27+
description: >-
2728
What should the tag be? All tags are in the format `subcategory: tag`

.github/codecov.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# codecov used to be able to find this anywhere, now we have to manually
22
# tell it where to look
3+
---
34
comment: false
45

56
codecov:
67
notify:
7-
require_ci_to_pass: no
8+
require_ci_to_pass: false
89

910
coverage:
1011
status:
@@ -13,20 +14,20 @@ coverage:
1314
target: 50%
1415
if_no_uploads: error
1516
if_not_found: success
16-
if_ci_failed: failure
17+
if_ci_failed: error
1718
project:
1819
default: false
1920
library:
2021
target: 50%
2122
if_no_uploads: error
2223
if_not_found: success
23-
if_ci_failed: failure
24+
if_ci_failed: error
2425
paths:
2526
- '!lib/.*/tests/.*'
2627
tests:
2728
target: auto
2829
if_no_uploads: error
2930
if_not_found: success
30-
if_ci_failed: failure
31+
if_ci_failed: error
3132
paths:
3233
- 'lib/.*/tests/.*'

.github/dependabot.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: 2
23
updates:
34
- package-ecosystem: "github-actions"

.github/labeler.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@
7676

7777
"Documentation: API":
7878
- all:
79-
- changed-files:
80-
- any-glob-to-any-file:
81-
# Also files in lib/**, but we can't be sure those are only documentation.
82-
- 'doc/api/**'
83-
- all-globs-to-all-files:
84-
- '!doc/api/next_api_changes/**'
79+
- changed-files:
80+
- any-glob-to-any-file:
81+
# Also files in lib/**, but we can't be sure those are only documentation.
82+
- 'doc/api/**'
83+
- all-globs-to-all-files:
84+
- '!doc/api/next_api_changes/**'
8585

8686
"Documentation: build":
8787
- changed-files:
@@ -107,12 +107,12 @@
107107
- 'galleries/tutorials/**'
108108
"Documentation: user guide":
109109
- all:
110-
- changed-files:
111-
- any-glob-to-any-file:
112-
- 'doc/users/**'
113-
- 'galleries/users_explain/**'
114-
- all-globs-to-all-files:
115-
- '!doc/users/next_whats_new/**'
110+
- changed-files:
111+
- any-glob-to-any-file:
112+
- 'doc/users/**'
113+
- 'galleries/users_explain/**'
114+
- all-globs-to-all-files:
115+
- '!doc/users/next_whats_new/**'
116116

117117
"topic: animation":
118118
- changed-files:

.github/workflows/cibuildwheel.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ permissions:
2323

2424
jobs:
2525
build_sdist:
26-
if: |
26+
if: >-
2727
github.event_name == 'push' ||
2828
github.event_name == 'pull_request' && (
2929
(
@@ -76,7 +76,7 @@ jobs:
7676
if-no-files-found: error
7777

7878
build_wheels:
79-
if: |
79+
if: >-
8080
github.event_name == 'push' ||
8181
github.event_name == 'pull_request' && (
8282
(
@@ -101,9 +101,10 @@ jobs:
101101
# If using all `--pre` releases creates issues, the NumPy wheel can be
102102
# installed more targeted.
103103
CIBW_BUILD_FRONTEND: >-
104-
${{ (((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
104+
${{ ((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
105105
(github.event_name == 'pull_request' && github.base_ref == 'main')) &&
106-
'pip; args: --pre --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"') ||
106+
'pip; args: --pre
107+
--extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"' ||
107108
'build' }}
108109
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
109110
delvewheel repair -w {dest_dir} {wheel}
@@ -146,39 +147,39 @@ jobs:
146147
path: dist/
147148

148149
- name: Build wheels for CPython 3.12
149-
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
150+
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
150151
with:
151152
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
152153
env:
153154
CIBW_BUILD: "cp312-*"
154155
CIBW_ARCHS: ${{ matrix.cibw_archs }}
155156

156157
- name: Build wheels for CPython 3.11
157-
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
158+
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
158159
with:
159160
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
160161
env:
161162
CIBW_BUILD: "cp311-*"
162163
CIBW_ARCHS: ${{ matrix.cibw_archs }}
163164

164165
- name: Build wheels for CPython 3.10
165-
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
166+
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
166167
with:
167168
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
168169
env:
169170
CIBW_BUILD: "cp310-*"
170171
CIBW_ARCHS: ${{ matrix.cibw_archs }}
171172

172173
- name: Build wheels for CPython 3.9
173-
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
174+
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
174175
with:
175176
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
176177
env:
177178
CIBW_BUILD: "cp39-*"
178179
CIBW_ARCHS: ${{ matrix.cibw_archs }}
179180

180181
- name: Build wheels for PyPy
181-
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
182+
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
182183
with:
183184
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
184185
env:
@@ -212,4 +213,4 @@ jobs:
212213
run: ls dist
213214

214215
- name: Publish package distributions to PyPI
215-
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
216+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11

.github/workflows/clean_pr.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ jobs:
4848
- name: Check for branches opened against main
4949
if: github.ref_name == 'main'
5050
run: |
51-
printf 'PR branch should not be main. See https://matplotlib.org/devdocs/devel/development_workflow.html#make-a-new-feature-branch'
51+
echo 'PR branch should not be main.'
52+
echo 'See https://matplotlib.org/devdocs/devel/development_workflow.html#make-a-new-feature-branch'
5253
exit 1

0 commit comments

Comments
 (0)