Skip to content

Commit e777a60

Browse files
Add standard pre-commit hooks (#146)
* Add a few more pre-commit hooks * Apply pre-commit fixes * Apply pre-commit fixes * Add back CSS * Remove csslint * Pretty format JSON * Add some more pre-commit hooks * Remove a comment * Remove flaky pre-commit hook * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1c9b6a4 commit e777a60

25 files changed

+149
-101
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
- image: continuumio/miniconda3
66
steps:
77
- checkout
8-
- run:
8+
- run:
99
name: "Install nikola"
1010
command: pip install nikola
1111
- run:

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- name: Build and Deploy Nikola
1717
uses: getnikola/nikola-action@v8
1818
with:
19-
dry_run: false
19+
dry_run: false

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ web/.doit.db.dir
2020
*.egg
2121
.venv
2222
venv
23-
ENV
23+
ENV

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@ ci:
44

55
repos:
66

7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.4.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-merge-conflict
13+
exclude: .*\.rst
14+
- id: check-case-conflict
15+
- id: check-json
16+
- id: pretty-format-json
17+
args: [--autofix, --no-sort-keys]
18+
- id: detect-private-key
19+
- id: check-toml
20+
- id: check-yaml
21+
- id: mixed-line-ending
22+
723
- repo: https://github.com/codespell-project/codespell
824
rev: v2.2.5
925
hooks:
1026
- id: codespell
1127
args: [--write-changes]
1228
additional_dependencies:
1329
- tomli
30+
31+
- repo: https://github.com/python-jsonschema/check-jsonschema
32+
rev: 0.26.3
33+
hooks:
34+
- id: check-github-workflows

CONTRIBUTING.md

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

33
## Prerequisites
44

5-
[PlasmaPy's website](https://www.plasmapy.org) is built using the
6-
[Nikola](https://getnikola.com/) static website generator. In order to build
7-
the website locally on your computer, you will need to [install
8-
Nikola](https://getnikola.com/getting-started.html#install). This may
5+
[PlasmaPy's website](https://www.plasmapy.org) is built using the
6+
[Nikola](https://getnikola.com/) static website generator. In order to build
7+
the website locally on your computer, you will need to [install
8+
Nikola](https://getnikola.com/getting-started.html#install). This may
99
be done for your local Python installation using `pip`.
10-
10+
1111
```bash
1212
pip install nikola
1313
```
@@ -23,20 +23,20 @@ pip install nikola
2323
The following steps will set up your local computer in order to submit a
2424
contribution of code or content to PlasmaPy's website.
2525

26-
1. [Create a fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) of the [PlasmaPy/plasmapy.github.io repository](https://github.com/PlasmaPy/plasmapy.github.io) on GitHub.
26+
1. [Create a fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) of the [PlasmaPy/plasmapy.github.io repository](https://github.com/PlasmaPy/plasmapy.github.io) on GitHub.
2727

2828
2. [Clone your fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork) using [git](https://git-scm.com/), and enter the directory.
2929

3030
```bash
31-
git clone https://github.com/username/plasmapy.github.io.git
31+
git clone https://github.com/username/plasmapy.github.io.git
3232
cd plasmapy.github.io
3333
```
3434

3535
where *username* is your GitHub username.
3636

3737
3. [Add a remote](https://help.github.com/en/github/using-git/adding-a-remote)
3838
to connect to the upstream repository.
39-
39+
4040
```bash
4141
git remote add upstream https://github.com/PlasmaPy/plasmapy.github.io.git
4242
```
@@ -47,21 +47,21 @@ Nikola's source files are located on the `src` git branch, and the built HTML fi
4747

4848
## Submitting a code contribution
4949

50-
1. Fetch the most recent updates to the repository.
50+
1. Fetch the most recent updates to the repository.
5151

5252
```bash
5353
git fetch --all
5454
```
55-
56-
2. Create and check out a branch based off of the
55+
56+
2. Create and check out a branch based off of the
5757
[`src`](https://github.com/PlasmaPy/plasmapy.github.io/tree/src)
5858
branch of the upstream repository, and connect it to a new branch
5959
in your fork on GitHub.
6060

6161
```bash
6262
git checkout -b new-branch-name upstream/src
6363
git push --set-upstream origin new-branch-name
64-
```
64+
```
6565

6666
3. Make and commit changes in the `web/` directory. Most of the pages
6767
are in `web/pages/` while blog posts are in `web/posts/`.
@@ -77,15 +77,15 @@ Nikola's source files are located on the `src` git branch, and the built HTML fi
7777
7878
```bash
7979
nikola auto --browser
80-
81-
6. [Create a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
80+
81+
6. [Create a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)
8282
to the `src` branch on the main repository.
83-
84-
7. The website will be rebuilt automatically after the pull request is merged.
83+
84+
7. The website will be rebuilt automatically after the pull request is merged.
8585
After five to ten minutes, check that the website is functioning nominally.
86-
86+
8787
## Getting help
8888
89-
The quickest way to contact PlasmaPy developers is through the
89+
The quickest way to contact PlasmaPy developers is through the
9090
[Matrix](https://riot.im/app/#/room/#plasmapy:openastronomy.org)/[Gitter](https://gitter.im/PlasmaPy/Lobby)
91-
channel.
91+
channel.

conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import time
42

53
# !! This is the configuration of Nikola. !! #

data/affiliated_pkgs.json

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
"long": "PlasmaPy is an open-source community developed Python 3 package for plasma physics. PlasmaPy intends to be a collection of functionality commonly used and shared between plasma physicists and researchers globally."
1515
},
1616
"affiliated": false,
17-
"keywords": ["plasma", "physics", "Python 3"],
17+
"keywords": [
18+
"plasma",
19+
"physics",
20+
"Python 3"
21+
],
1822
"dates": {
1923
"added": "2020 November 12",
2024
"last_updated": "2020 November 12"
@@ -37,7 +41,13 @@
3741
"long": "<code>tofu</code> is an open-source python library. It aims at providing the user with a ready-set toolbox for modelling synthetic diagnostics and performing tomographic inversions on linear or toroidal (quasi-axisymmetric) fusion devices. It is relevant for diagnostics integrating an emissivity on a set of Lines of Sight or Volumes of Sight corresponding to as many detectors or pixels, and for which the plasma can be considered transparent (i.e. not for radio-frequencies / microwaves)."
3842
},
3943
"affiliated": true,
40-
"keywords": ["plasma", "physics", "Python 3", "fusion", "diagnostics"],
44+
"keywords": [
45+
"plasma",
46+
"physics",
47+
"Python 3",
48+
"fusion",
49+
"diagnostics"
50+
],
4151
"dates": {
4252
"added": "2020 November 17",
4353
"last_updated": "2020 November 17"
@@ -60,7 +70,15 @@
6070
"long": "OMFIT - One Modeling Framework for Integrated Tasks - is an integrated modeling and experimental data analysis framework written in python. The goal of OMFIT is to enhance existing scientific workflows and enable new integrated modeling capabilities."
6171
},
6272
"affiliated": false,
63-
"keywords": ["plasma", "physics", "Python", "Python 3", "fusion", "simulation", "diagnostics"],
73+
"keywords": [
74+
"plasma",
75+
"physics",
76+
"Python",
77+
"Python 3",
78+
"fusion",
79+
"simulation",
80+
"diagnostics"
81+
],
6482
"dates": {
6583
"added": "2021 June 22",
6684
"last_updated": "2021 June 22"
@@ -83,7 +101,13 @@
83101
"long": "A Monte Carlo simulation of electron transport in low temperature plasmas."
84102
},
85103
"affiliated": false,
86-
"keywords": ["plasma", "physics", "Python 3", "simulation", "low-temperature"],
104+
"keywords": [
105+
"plasma",
106+
"physics",
107+
"Python 3",
108+
"simulation",
109+
"low-temperature"
110+
],
87111
"dates": {
88112
"added": "2021 June 23",
89113
"last_updated": "2021 June 23"
@@ -106,7 +130,14 @@
106130
"long": "<code>ALOHA</code> is a coupling code for Lower Hybrid Current Drive antennas facing tokamak magnetized fusion plasma. This coupling code is based on the linear coupling theory. It allows one to model the coupling of a 'grill'-like antenna to a cold plasma of the kind one can find in Tokamaks. It allows taking into account advanced antennas (such as multijunctions or passive-active multijunction antennas)."
107131
},
108132
"affiliated": false,
109-
"keywords": ["Fortran", "MatLab", "plasma", "physics", "fusion", "simulation"],
133+
"keywords": [
134+
"Fortran",
135+
"MatLab",
136+
"plasma",
137+
"physics",
138+
"fusion",
139+
"simulation"
140+
],
110141
"dates": {
111142
"added": "2021 July 16",
112143
"last_updated": "2021 July 16"

pages/affiliates/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ title: Plasma Packages
22
hidetitle: True
33
author: Erik T. Everson
44

5-
PlasmaPy's charter includes promoting open-source software for all of
6-
the plasma community, and not just `plasmapy`. We feel the entire community
7-
benefits when there are multiple efforts trying to build functionality for all
5+
PlasmaPy's charter includes promoting open-source software for all of
6+
the plasma community, and not just `plasmapy`. We feel the entire community
7+
benefits when there are multiple efforts trying to build functionality for all
88
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
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

1212
<div style="width: 100%">
1313
<a href=https://docs.google.com/forms/d/e/1FAIpQLSfz2djEihWkODbkr1ZC5splkX7ZKLAh_Kuy-aXOngTELIm3xQ/viewform?usp=sf_link
14-
class="feature-card feature-link btn-plasmapy-bluegreen"
14+
class="feature-card feature-link btn-plasmapy-bluegreen"
1515
style="width: 200px">
1616
<div>Submit Request</div>
1717
</a>
1818
</div>
1919
<br>
2020

21-
All projects/packages are considered **Community Packages**
21+
All projects/packages are considered **Community Packages**
2222
<span style="vertical-align: 2px">{{% community_shield %}}</span>, but packages designed with
23-
`plasmapy` interoperability are marked as **Affiliated Packages**
23+
`plasmapy` interoperability are marked as **Affiliated Packages**
2424
<span style="vertical-align: 2px">{{% affiliated_shield %}}</span>.
2525

2626
----

pages/contribute.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ slug: contribute
66
There are numerous ways to contribute to PlasmaPy, including by
77
providing code and documentation, suggesting and discussing ideas,
88
submitting issues and bug reports, and engaging the broader plasma
9-
physics community.
9+
physics community.
1010

1111
**Imposter syndrome disclaimer**: We want your help. No, really.
1212

@@ -30,8 +30,8 @@ the errors and assumptions that seasoned contributors have glossed over.
3030

3131
*This disclaimer was originally written by
3232
[Adrienne Lowe](https://github.com/adriennefriend) for a
33-
[PyCon talk](https://www.youtube.com/watch?v=6Uj746j9Heo), and was adapted by
34-
[yt](https://github.com/yt-project/yt) in their README file based on its use
33+
[PyCon talk](https://www.youtube.com/watch?v=6Uj746j9Heo), and was adapted by
34+
[yt](https://github.com/yt-project/yt) in their README file based on its use
3535
in the README file for the [MetPy project](https://github.com/Unidata/MetPy).
3636
It was then adapted by PlasmaPy.*
3737

@@ -50,10 +50,10 @@ early stages of PlasmaPy development:
5050
[submit issues](https://github.com/PlasmaPy/plasmapy/issues) and
5151
review [pull requests](https://github.com/PlasmaPy/plasmapy/pulls).
5252

53-
* The PlasmaPy [Matrix](https://app.element.io/#/room/#plasmapy:openastronomy.org) or
53+
* The PlasmaPy [Matrix](https://app.element.io/#/room/#plasmapy:openastronomy.org) or
5454
[Gitter](https://gitter.im/PlasmaPy/Lobby) joint channel
5555
is a great place to have informal conversations, coordinate efforts,
56-
and share ideas.
56+
and share ideas.
5757
* We have biweekly telecons which are announced on the email list.
5858

5959
## Contributing code or documentation to PlasmaPy

pages/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ hidetitle: True
66
<!-- Feature 1 -->
77
<div class="feature-column">
88
<a class="feature-link" href="meetings/office_hours">
9-
<div class="feature-card"
9+
<div class="feature-card"
1010
style="background-image: linear-gradient(rgba(255, 255, 255, 0.5),
11-
rgba(255, 255, 255, 0.5)),
11+
rgba(255, 255, 255, 0.5)),
1212
none;
1313
background-color: var(--plasmapy-light-red)">
1414
<div>
@@ -33,9 +33,9 @@ hidetitle: True
3333
<!-- Feature 3 -->
3434
<div class="feature-column">
3535
<a class="feature-link" href="https://hack.plasmapy.org">
36-
<div class="feature-card"
37-
style="background-image: linear-gradient(rgba(255, 255, 255, 0.0),
38-
rgba(255, 255, 255, 0.0)),
36+
<div class="feature-card"
37+
style="background-image: linear-gradient(rgba(255, 255, 255, 0.0),
38+
rgba(255, 255, 255, 0.0)),
3939
none;
4040
background-color: var(--plasmapy-darkblue)">
4141
<div>
@@ -53,7 +53,7 @@ hidetitle: True
5353
<div class="aspect-ratio-80pc">
5454
<iframe src="https://www.youtube-nocookie.com/embed/E8RwQF5wcXM"
5555
style="border: 1px solid black"
56-
frameborder="0"
56+
frameborder="0"
5757
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
5858
allowfullscreen>
5959
</iframe>
@@ -79,14 +79,14 @@ If you have a working installation of [conda](https://docs.conda.io/en/latest/),
7979
conda install -c conda-forge plasmapy
8080
```
8181

82-
[PlasmaPy's online documentation](https://docs.plasmapy.org/) contains more
82+
[PlasmaPy's online documentation](https://docs.plasmapy.org/) contains more
8383
detailed [installation instructions](https://docs.plasmapy.org/en/latest/install.html).
84-
If you are unfamiliar with Python, please check out the
84+
If you are unfamiliar with Python, please check out the
8585
[Python website](https://www.python.org/) for more information.
8686

8787
## Learn PlasmaPy
8888

89-
[PlasmaPy's documentation](http://docs.plasmapy.org/en/latest) describes how to use PlasmaPy and provides several [examples](https://docs.plasmapy.org/en/latest/examples.html).
89+
[PlasmaPy's documentation](http://docs.plasmapy.org/en/latest) describes how to use PlasmaPy and provides several [examples](https://docs.plasmapy.org/en/latest/examples.html).
9090

9191
## Get Help
9292

0 commit comments

Comments
 (0)