Skip to content

Commit 8793615

Browse files
authored
DOC: Document code contributors on website (#12774)
1 parent b8b1680 commit 8793615

23 files changed

Lines changed: 706 additions & 60 deletions

.circleci/config.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,9 @@ jobs:
433433
mne sys_info -pd
434434
- run:
435435
name: make linkcheck
436+
no_output_timeout: 40m
436437
command: |
437438
make -C doc linkcheck
438-
- run:
439-
name: make linkcheck-grep
440-
when: always
441-
command: |
442-
make -C doc linkcheck-grep
443439
- store_artifacts:
444440
path: doc/_build/linkcheck
445441
destination: linkcheck

.git-blame-ignore-revs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
e81ec528a42ac687f3d961ed5cf8e25f236925b0 # black
2-
12395f9d9cf6ea3c72b225b62e052dd0d17d9889 # YAML indentation
3-
d6d2f8c6a2ed4a0b27357da9ddf8e0cd14931b59 # isort
4-
e7dd1588013179013a50d3f6b8e8f9ae0a185783 # ruff format
5-
e39995d9be6fc831c7a4a59f09b7a7c0a41ae315 # percent formatting
6-
940ac9553ce42c15b4c16ecd013824ca3ea7244a # whitespace
7-
1c5b39ff1d99bbcb2fc0e0071a989b3f3845ff30 # ruff UP028
1+
# PR number should follow the commit number so that our code credit
2+
# can parse this file correctly:
3+
d71e497dcf6f98e19eb81e82e641404a71d2d663 # 1420, split up viz.py
4+
203a96cbba2732d2e349a8f96065e74bbfd2a53b # 5862, split utils.py
5+
ff349f356edb04e1b5f0db13deda8d1a20aca351 # 6767, move around manual parts
6+
31a83063557fbd54d898f00f9527ffc547888395 # 10407, alphabetize docdict
7+
e81ec528a42ac687f3d961ed5cf8e25f236925b0 # 11667, black
8+
12395f9d9cf6ea3c72b225b62e052dd0d17d9889 # 11868, YAML indentation
9+
d6d2f8c6a2ed4a0b27357da9ddf8e0cd14931b59 # 12097, isort
10+
e7dd1588013179013a50d3f6b8e8f9ae0a185783 # 12261, ruff format
11+
940ac9553ce42c15b4c16ecd013824ca3ea7244a # 12533, whitespace
12+
e39995d9be6fc831c7a4a59f09b7a7c0a41ae315 # 12588, percent formatting
13+
1c5b39ff1d99bbcb2fc0e0071a989b3f3845ff30 # 12603, ruff UP028
14+
b8b168088cb474f27833f5f9db9d60abe00dca83 # 12779, PR JSONs

.github/workflows/credit.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Contributor credit
2+
3+
on: # yamllint disable-line rule:truthy
4+
# Scheduled actions only run on the main repo branch, which is exactly what we want
5+
schedule:
6+
# TODO: After making sure it works in `main` for a while, switch to monthly
7+
# - cron: '0 0 1 * *' # first day of the month at midnight
8+
- cron: '0 0 * * *' # every day at midnight
9+
10+
permissions:
11+
pull-requests: write
12+
13+
jobs:
14+
update_credit:
15+
name: Update
16+
runs-on: ubuntu-latest
17+
env:
18+
GH_TOKEN: ${{ github.token }}
19+
GITHUB_TOKEN: ${{ github.token }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
- run: pip install pygithub -e .
26+
- run: git checkout -b credit
27+
- run: python tools/dev/update_credit_json.py
28+
- run: python tools/dev/update_credit_rst.py
29+
- run: git add -f doc/sphinxext/prs/*.json
30+
- run: |
31+
git diff && git status --porcelain
32+
if [[ $(git status --porcelain) ]]; then
33+
echo "dirty=true" >> $GITHUB_OUTPUT
34+
fi
35+
id: status
36+
- name: Create PR
37+
run: |
38+
set -xeo pipefail
39+
git config --global user.email "114827586+autofix-ci[bot]@users.noreply.github.com"
40+
git config --global user.name "autofix-ci[bot]"
41+
git commit -am "MAINT: Update code credit"
42+
gh pr create -B main -H credit --title "MAINT: Update code credit" --body "Created by \"${{ github.workflow }}\" GitHub action." --label "no-changelog-entry-needed"
43+
if: steps.status.outputs.dirty == 'true'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ cover
9797

9898
.venv/
9999
venv/
100-
*.json
100+
/*.json
101101
!codemeta.json
102102
.hypothesis/
103103
.ruff_cache/

.mailmap

Lines changed: 73 additions & 34 deletions
Large diffs are not rendered by default.

.pre-commit-config.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ repos:
66
- id: ruff
77
name: ruff lint mne
88
args: ["--fix"]
9-
files: ^mne/
9+
files: ^mne/|^tools/
10+
exclude: vulture_allowlist.py
1011
- id: ruff
1112
name: ruff lint mne preview
1213
args: ["--fix", "--preview", "--select=NPY201"]
13-
files: ^mne/
14+
files: ^mne/|^tools/
1415
- id: ruff
1516
name: ruff lint doc, tutorials, and examples
1617
# D103: missing docstring in public function
1718
# D400: docstring first line must end with period
1819
args: ["--ignore=D103,D400", "--fix"]
1920
files: ^doc/|^tutorials/|^examples/
2021
- id: ruff-format
21-
files: ^mne/|^doc/|^tutorials/|^examples/
22+
files: ^mne/|^doc/|^tutorials/|^examples/|^tools/
2223

2324
# Codespell
2425
- repo: https://github.com/codespell-project/codespell
@@ -27,7 +28,7 @@ repos:
2728
- id: codespell
2829
additional_dependencies:
2930
- tomli
30-
files: ^mne/|^doc/|^examples/|^tutorials/
31+
files: ^mne/|^doc/|^examples/|^tutorials/|^tools/
3132
types_or: [python, bib, rst, inc]
3233

3334
# yamllint
@@ -45,13 +46,15 @@ repos:
4546
additional_dependencies:
4647
- tomli
4748
files: ^doc/.*\.(rst|inc)$
49+
# Credit is problematic because we generate an include on the fly
50+
exclude: ^doc/credit.rst$
4851

4952
# sorting
5053
- repo: https://github.com/pre-commit/pre-commit-hooks
5154
rev: v4.6.0
5255
hooks:
5356
- id: file-contents-sorter
54-
files: ^doc/changes/names.inc
57+
files: ^doc/changes/names.inc|^.mailmap
5558
args: ["--ignore-case"]
5659

5760
# The following are too slow to run on local commits, so let's only run on CIs:

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/code_credit.inc

doc/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ html_dev-noplot: html-noplot
6565
html_dev-front: html-front
6666

6767
linkcheck:
68-
@$(SPHINXBUILD) -b linkcheck -D nitpicky=0 -D plot_gallery=0 -D exclude_patterns="cited.rst,whats_new.rst,configure_git.rst,_includes,changes/devel" -d _build/doctrees . _build/linkcheck
69-
70-
linkcheck-grep:
71-
@! grep -h "^.*:.*: \[\(\(local\)\|\(broken\)\)\]" _build/linkcheck/output.txt
68+
@$(SPHINXBUILD) -b linkcheck -D nitpicky=0 -q -D plot_gallery=0 -D exclude_patterns="cited.rst,whats_new.rst,configure_git.rst,_includes,changes/devel" -d _build/doctrees . _build/linkcheck
7269

7370
doctest:
7471
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest

doc/_templates/sidebar-quicklinks.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ <h5 class="card-header font-weight-bold">Version {{ release }}</h5>
77
<li><a href="{{ pathto('help/index.html', 1) }}"><i class="fas fa-circle-question fa-fw"></i> Get help</a></li>
88
<li><a href="{{ pathto('documentation/cite.html', 1) }}"><i class="fas fa-quote-left fa-fw"></i> Cite</a></li>
99
<li><a href="{{ pathto('development/contributing.html', 1) }}"><i class="fas fa-code-branch fa-fw"></i> Contribute</a></li>
10+
<li><a href="{{ pathto('credit.html', 1) }}"><i class="fas fa-hands-clapping fa-fw"></i> Contributors</a></li>
1011
</ul>
1112
</div>
1213
</div>

doc/changes/devel/12774.other.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Code contributions are now measured using PRs and reported on the :ref:`contributors`
2+
page, by `Eric Larson`_.

0 commit comments

Comments
 (0)