Skip to content

Commit

Permalink
ci!: import new developer environment (#10)
Browse files Browse the repository at this point in the history
* build!: switch to setuptools (setup.cfg)
* ci!: enforce cspell and fix errors
* ci!: remove travis
* ci!: switch to GitHub Actions
* ci: add GitHub release drafter
* ci: add PR title+label linting
* ci: add and enforce Prettier configuration
* ci: add and enforce markdownlint configuration
* ci: define tox environments
* ci: recommend specific VSCode extension
* docs!: remove ADRs
* docs: update badges
  • Loading branch information
redeboer committed Sep 4, 2020
1 parent 048ad07 commit fd0c601
Show file tree
Hide file tree
Showing 40 changed files with 579 additions and 229 deletions.
18 changes: 16 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
root = true

[*]
end_of_line = lf
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,toml}]
indent_size = 4

[*.{json,xml,yaml,yml}]
indent_size = 2

[*.{rst,inc}]
indent_size = 2

# when adding words through vscode, this is the resulting output format
[cspell.json]
indent_size = 4
insert_final_newline = false
26 changes: 26 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name-template: PWA Pages $NEXT_PATCH_VERSION
tag-template: $NEXT_PATCH_VERSION

categories:
- title: 📖 Theory
label: 📖 Theory
- title: 📖 Analysis
label: 📖 Analysis
- title: 📖 Software
label: 📖 Software
- title: 🔨 Internals
labels:
- 🖱️ DX
- 💡 Enhancement
- 🔨 Maintenance

change-template: "- $TITLE (#$NUMBER)"
sort-direction: ascending
template: |
# Release $NEXT_PATCH_VERSION
$CHANGES
## Contributors since [$PREVIOUS_TAG](https://github.com/ComPWA/PWA-pages/releases/tag/$PREVIOUS_TAG)
$CONTRIBUTORS
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# cspell:ignore markdownlint

name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
documentation:
name: Build and check documentation
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[doc]
sudo apt-get -y install pandoc
- name: Build HTML-pages
run: make html

style:
name: Style checks
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
sudo npm install -g cspell markdownlint-cli
- name: Perform style checks
run: tox -e sty
- name: Check spelling
run: cspell $(git ls-files)
- name: Lint Markdown files
run: markdownlint .
25 changes: 25 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Linkcheck

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
style:
name: Check external links
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[doc]
sudo apt-get -y install pandoc
- name: Check external links
run: make linkcheck
34 changes: 34 additions & 0 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# cspell:ignore agilepathway commitlint kode

name: PR linting
on:
pull_request:
types:
- edited
- labeled
- opened
- reopened
- synchronize
- unlabeled

jobs:
check-labels:
name: Check labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of: |
Bug,💡 Enhancement,📝 Docs,🔨 Maintenance,🖱️ DX,📖 Analysis,
📖 Software,📖 Theory
none_of: Epic,❌ Won't fix,💫 Good first issue
repo_token: ${{ secrets.GITHUB_TOKEN }}

check-title:
name: Check title
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: npm install @commitlint/config-conventional
- uses: JulienKode/[email protected]
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 18 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Build folders
build/
# Temporary files
.ipynb_checkpoints/
condaenv.*

# Visual Studio Code
*.code-workspace
# Build files
*.egg-info/
*build/
.fuse_*
dist/
htmlcov/
version.py

# Virtual environments
*venv/
.tox/

# Settings
**.code-workspace
.idea/
6 changes: 6 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"MD026": { "punctuation": ".,;:。,;:!" },
"MD033": {
"allowed_elements": ["br"]
}
}
22 changes: 18 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v3.2.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: cspell.json
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 19.10b0
rev: 20.8b1
hooks:
- id: black

- repo: https://github.com/prettier/prettier
rev: 2.0.5
rev: 2.1.1
hooks:
- id: prettier
language_version: 12.18.2 # prettier does not specify node correctly

- repo: local
hooks:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cspell.json
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"proseWrap": "always"
"proseWrap": "always",
"printWidth": 79
}
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ version: 2

sphinx:
configuration: conf.py
fail_on_warning: false

formats:
- htmlzip

python:
version: 3.7
install:
- requirements: requirements.txt
- method: pip
path: .[doc]
5 changes: 0 additions & 5 deletions .rstcheck.cfg

This file was deleted.

47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions .vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.ropeproject
24 changes: 24 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"recommendations": [
"bungcip.better-toml",
"christian-kohler.path-intellisense",
"davidanson.vscode-markdownlint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github",
"joaompinto.vscode-graphviz",
"lextudio.restructuredtext",
"ms-python.python",
"ms-vsliveshare.vsliveshare",
"redhat.vscode-yaml",
"ryanluker.vscode-coverage-gutters",
"stkb.rewrap",
"streetsidesoftware.code-spell-checker",
"travisillig.vscode-json-stable-stringify",
"trentrand.git-commit-helper-vscode",
"tyriar.sort-lines",
"yzhang.markdown-all-in-one"
],
"unwantedRecommendations": ["dbaeumer.vscode-eslint"]
}
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand All @@ -8,7 +11,9 @@
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.language": "en-US",
"cSpell.customFolderDictionaries": ["cspell.json"],
"cSpell.enabled": true,
"editor.formatOnSave": true,
"editor.rulers": [80],
"files.associations": {
"*.inc": "restructuredtext"
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[![Travis CI](https://travis-ci.com/ComPWA/PWA-pages.svg?branch=master)](https://travis-ci.com/ComPWA/PWA-pages)
# Welcome to the Partial Wave Analysis pages!

![Documentation build status](https://readthedocs.org/projects/pwa/badge/?version=latest)
![pre-commit enabled](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)
[![GPLv3+ license](https://img.shields.io/badge/License-GPLv3+-blue.svg)](https://www.gnu.org/licenses/gpl-3.0-standalone.html)
<br>
[![CI status](https://github.com/ComPWA/PWA-pages/workflows/CI/badge.svg)](https://github.com/ComPWA/PWA-pages/actions?query=branch%3Amaster+workflow%3ACI)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen)](https://github.com/pre-commit/pre-commit)
[![Prettier](https://camo.githubusercontent.com/687a8ae8d15f9409617d2cc5a30292a884f6813a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d70726574746965722d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://prettier.io/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# Welcome to the Partial Wave Analysis pages!

This repository contains the source code for the
[pwa.readthedocs.io](https://pwa.readthedocs.io/) pages.
[pwa.rtfd.io](https://pwa.readthedocs.io/) pages.
3 changes: 0 additions & 3 deletions adr/0000-write-introduction-to-pwa-theory.md

This file was deleted.

Loading

0 comments on commit fd0c601

Please sign in to comment.