Skip to content

Commit 525e26c

Browse files
authored
Update pre-commit configuration and add mdformat hook (#210)
* pre-commit autoupdate * Update ruff hooks * Add hook for mdformat * Apply mdformat changes * Add mdformat-ruff plugin * Use mdformat --number for numbered lists
1 parent 6ad81d9 commit 525e26c

15 files changed

Lines changed: 186 additions & 161 deletions

File tree

.pre-commit-config.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ repos:
5050
- id: forbid-bidi-controls
5151

5252
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
53-
rev: v2.15.0
53+
rev: v2.16.0
5454
hooks:
5555
- id: pretty-format-ini
5656
args: [--autofix]
@@ -63,10 +63,19 @@ repos:
6363
exclude: .github/labeler.yml|.pre-commit-search-and-replace.yaml
6464

6565
- repo: https://github.com/astral-sh/ruff-pre-commit
66-
rev: v0.14.10
66+
rev: v0.14.11
6767
hooks:
68-
- id: ruff
69-
name: ruff (see https://docs.astral.sh/ruff/rules)
68+
- id: ruff-check
69+
name: ruff-check (see https://docs.astral.sh/ruff/rules)
7070
args: [--fix]
7171
- id: ruff-format
7272
name: autoformat source code with ruff formatter
73+
74+
- repo: https://github.com/hukkin/mdformat
75+
rev: 1.0.0
76+
hooks:
77+
- id: mdformat
78+
args: [--number]
79+
additional_dependencies:
80+
- mdformat-gfm
81+
- mdformat-ruff

CONTRIBUTING.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
## Prerequisites
44

55
[PlasmaPy's website](https://www.plasmapy.org) is built using the
6-
[Nikola](https://getnikola.com/) static website generator. In order to build
6+
[Nikola](https://getnikola.com/) static website generator. In order to build
77
the website locally on your computer, you will need to [install
8-
Nikola](https://getnikola.com/getting-started.html#install). This may
8+
Nikola](https://getnikola.com/getting-started.html#install). This may
99
be done for your local Python installation using `pip`.
1010

1111
```bash
@@ -14,9 +14,9 @@ pip install nikola
1414

1515
## Resources
1616

17-
- [git](https://git-scm.com/)
18-
- [Nikola documentation](https://getnikola.com/documentation.html)
19-
- [Markdown guide](https://www.markdownguide.org/)
17+
- [git](https://git-scm.com/)
18+
- [Nikola documentation](https://getnikola.com/documentation.html)
19+
- [Markdown guide](https://www.markdownguide.org/)
2020

2121
## Getting started
2222

@@ -52,9 +52,9 @@ Nikola's source files are located on the `main` git branch, and the built HTML f
5252

5353
1. Fetch the most recent updates to the repository.
5454

55-
```bash
56-
git fetch --all
57-
```
55+
```bash
56+
git fetch --all
57+
```
5858

5959
2. Create and check out a branch based off of the
6060
[`main`](https://github.com/PlasmaPy/plasmapy.github.io/tree/main)
@@ -66,7 +66,7 @@ Nikola's source files are located on the `main` git branch, and the built HTML f
6666
git push --set-upstream origin new-branch-name
6767
```
6868

69-
3. Make and commit changes in the `pages/` directory. Most of the pages
69+
3. Make and commit changes in the `pages/` directory. Most of the pages
7070
are in `pages/` while blog posts are in `web/posts/`.
7171

7272
```bash
@@ -81,10 +81,12 @@ Nikola's source files are located on the `main` git branch, and the built HTML f
8181
```bash
8282
nikola auto --browser
8383

84-
6. [Create a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
84+
```
85+
86+
5. [Create a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
8587
to the `main` branch.
8688

87-
7. The website will be rebuilt automatically after the pull request is merged.
89+
6. The website will be rebuilt automatically after the pull request is merged.
8890
After five to ten minutes, check that the website is functioning nominally.
8991

9092
## Getting help

LICENSE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Source code files and code snippets included in this project are
44
licensed under a [BSD 3-clause license with a patent
5-
grant](#bsd-3-clause-license-with-patent-grant). All other content in
5+
grant](#bsd-3-clause-license-with-patent-grant). All other content in
66
this project, including content produced directly from unmodified
77
source code and code snippets, is licensed under a [Creative Commons
88
Attribution 4.0 International (CC BY 4.0)
@@ -16,14 +16,14 @@ Redistribution and use in source and binary forms, with or without
1616
modification, are permitted provided that the following conditions are
1717
met:
1818

19-
* Redistributions of source code must retain the above copyright
19+
- Redistributions of source code must retain the above copyright
2020
notice, this list of conditions and the following disclaimer.
2121

22-
* Redistributions in binary form must reproduce the above copyright
22+
- Redistributions in binary form must reproduce the above copyright
2323
notice, this list of conditions and the following disclaimer in the
2424
documentation and/or other materials provided with the distribution.
2525

26-
* Neither the name of PlasmaPy nor the names of its contributors may
26+
- Neither the name of PlasmaPy nor the names of its contributors may
2727
be used to endorse or promote products derived from this software
2828
without specific prior written permission.
2929

pages/about.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ hidetitle: False
44

55
# About PlasmaPy
66

7-
[Astropy]: https://www.astropy.org
8-
[PlasmaPy core package]: https://docs.plasmapy.org
9-
107
The mission of the PlasmaPy Project is to foster the creation of a
118
fully open source software ecosystem for plasma research and
12-
education. The [PlasmaPy core package] intends to be for plasma
9+
education. The [PlasmaPy core package] intends to be for plasma
1310
science what [Astropy] is for astronomy — a collection of
1411
functionality commonly used and shared between plasma physicists and
1512
researchers globally, running within and leveraging the open source
1613
scientific Python ecosystem.
14+
15+
[astropy]: https://www.astropy.org
16+
[plasmapy core package]: https://docs.plasmapy.org

pages/affiliates/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ author: Erik T. Everson
55
PlasmaPy's charter includes promoting open source software for all of
66
the plasma community, and not just PlasmaPy. The entire community
77
benefits when there are multiple efforts trying to build functionality for all
8-
aspects of the plasma field. As such, we want to promote any ongoing effort. This
9-
page displays projects that have requested to be shown. If you want your
8+
aspects of the plasma field. As such, we want to promote any ongoing effort. This
9+
page displays projects that have requested to be shown. If you want your
1010
project include, and increase its visibility, then please submit a request
1111
to <team@plasmapy.org>.
1212

@@ -15,6 +15,6 @@ All projects/packages are considered **Community Packages**
1515
PlasmaPy interoperability are marked as **Affiliated Packages**
1616
<span style="vertical-align: 2px">{{% affiliated_shield %}}</span>.
1717

18-
----
18+
______________________________________________________________________
1919

2020
{{% build_affiliated_pkg_list %}}

pages/index.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
title: The PlasmaPy Project
22
hidetitle: True
33

4-
[conda]: https://docs.conda.io/en/latest
5-
[pip]: https://pip.pypa.io/en/stable
6-
[code contribution workflow]: https://docs.plasmapy.org/en/latest/contributing/workflow.html
7-
[coding guidelines]: https://docs.plasmapy.org/en/latest/contributing/coding_guide.html
8-
[community meeting]: https://www.plasmapy.org/meetings/weekly/
9-
[**contributor guide**]: https://docs.plasmapy.org/en/latest/contributing/index.html
10-
[feature requests]: https://github.com/PlasmaPy/PlasmaPy/issues/new?assignees=&labels=feature+request&projects=&template=feature_request.yml
11-
[gallery of example notebooks]: https://docs.plasmapy.org/en/stable/examples.html
12-
[getting ready to contribute]: https://docs.plasmapy.org/en/latest/contributing/getting_ready.html
13-
[GitHub Discussions]: https://github.com/PlasmaPy/PlasmaPy/discussions
14-
[installation instructions]: https://docs.plasmapy.org/en/latest/install.html
15-
[many ways to contribute]: https://docs.plasmapy.org/en/latest/contributing/many_ways.html
16-
[PlasmaPy's documentation]: https://docs.plasmapy.org/en/stable
17-
[Python]: https://www.python.org
18-
[submitting bug reports]: https://github.com/PlasmaPy/PlasmaPy/issues/new?assignees=&labels=Bug&projects=&template=bug_report.yml
19-
[writing documentation]: https://docs.plasmapy.org/en/latest/contributing/doc_guide.html
20-
[writing tests]: https://docs.plasmapy.org/en/latest/contributing/testing_guide.html
21-
224
<!-- YouTube Video-->
5+
236
<div class="aspect-ratio-80pc">
247
<iframe src="https://www.youtube-nocookie.com/embed/E8RwQF5wcXM"
258
style="border: 1px solid black"
@@ -53,7 +36,7 @@ conda install -c conda-forge plasmapy
5336
```
5437

5538
[PlasmaPy's documentation] contains more detailed [installation
56-
instructions]. If you are unfamiliar with Python, please check out the
39+
instructions][installation instructions]. If you are unfamiliar with Python, please check out the
5740
[Python] website.
5841

5942
## Learn PlasmaPy
@@ -71,7 +54,7 @@ a PlasmaPy [community meeting].
7154
There are [many ways to contribute] to an open source project, including
7255
making [feature requests], [submitting bug reports], and organizing
7356
events. PlasmaPy's [**contributor guide**] covers [getting ready to
74-
contribute], the [code contribution workflow], [coding guidelines],
57+
contribute][getting ready to contribute], the [code contribution workflow], [coding guidelines],
7558
[writing tests], and [writing documentation].
7659

7760
## Acknowledgments
@@ -80,3 +63,21 @@ Development of PlasmaPy has been supported by the U.S. National Science
8063
Foundation, the U.S. Department of Energy, the Smithsonian Institution,
8164
NASA, and Google Summer of Code, with many contributions from the
8265
broader plasma physics and open source communities.
66+
67+
[**contributor guide**]: https://docs.plasmapy.org/en/latest/contributing/index.html
68+
[code contribution workflow]: https://docs.plasmapy.org/en/latest/contributing/workflow.html
69+
[coding guidelines]: https://docs.plasmapy.org/en/latest/contributing/coding_guide.html
70+
[community meeting]: https://www.plasmapy.org/meetings/weekly/
71+
[conda]: https://docs.conda.io/en/latest
72+
[feature requests]: https://github.com/PlasmaPy/PlasmaPy/issues/new?assignees=&labels=feature+request&projects=&template=feature_request.yml
73+
[gallery of example notebooks]: https://docs.plasmapy.org/en/stable/examples.html
74+
[getting ready to contribute]: https://docs.plasmapy.org/en/latest/contributing/getting_ready.html
75+
[github discussions]: https://github.com/PlasmaPy/PlasmaPy/discussions
76+
[installation instructions]: https://docs.plasmapy.org/en/latest/install.html
77+
[many ways to contribute]: https://docs.plasmapy.org/en/latest/contributing/many_ways.html
78+
[pip]: https://pip.pypa.io/en/stable
79+
[plasmapy's documentation]: https://docs.plasmapy.org/en/stable
80+
[python]: https://www.python.org
81+
[submitting bug reports]: https://github.com/PlasmaPy/PlasmaPy/issues/new?assignees=&labels=Bug&projects=&template=bug_report.yml
82+
[writing documentation]: https://docs.plasmapy.org/en/latest/contributing/doc_guide.html
83+
[writing tests]: https://docs.plasmapy.org/en/latest/contributing/testing_guide.html

pages/license.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ slug: license
55

66
Source code files and code snippets included in this project are
77
licensed under a [BSD 3-clause license with a patent
8-
grant](#bsd-3-clause-license-with-patent-grant). All other content in
8+
grant](#bsd-3-clause-license-with-patent-grant). All other content in
99
this project, including content produced directly from unmodified
1010
source code and code snippets, is licensed under a [Creative Commons
1111
Attribution 4.0 International (CC BY 4.0)
@@ -19,14 +19,14 @@ Redistribution and use in source and binary forms, with or without
1919
modification, are permitted provided that the following conditions are
2020
met:
2121

22-
* Redistributions of source code must retain the above copyright
22+
- Redistributions of source code must retain the above copyright
2323
notice, this list of conditions and the following disclaimer.
2424

25-
* Redistributions in binary form must reproduce the above copyright
25+
- Redistributions in binary form must reproduce the above copyright
2626
notice, this list of conditions and the following disclaimer in the
2727
documentation and/or other materials provided with the distribution.
2828

29-
* Neither the name of PlasmaPy nor the names of its contributors may
29+
- Neither the name of PlasmaPy nor the names of its contributors may
3030
be used to endorse or promote products derived from this software
3131
without specific prior written permission.
3232

0 commit comments

Comments
 (0)