Skip to content

Commit

Permalink
MAINT: synchronize ComPWA dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Oct 9, 2023
1 parent 5606278 commit 96b1969
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 25 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PYTHONHASHSEED: "0"

on:
push:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
pull_request:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
workflow_dispatch:
inputs:
specific-pip-packages:
description: Run CI with specific pip packages
required: false
type: string

jobs:
style:
if: inputs.specific-pip-packages == ''
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v1
22 changes: 22 additions & 0 deletions .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Clean caches

on:
pull_request:
types:
- closed
workflow_dispatch:
inputs:
ref:
description: Clean caches for this branch name or ref
required: false
type: string

jobs:
cleanup:
name: Remove caches
runs-on: ubuntu-22.04
steps:
- uses: ComPWA/actions/clean-caches@v1
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.ref }}
33 changes: 33 additions & 0 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR linting
on:
pull_request:
types:
- edited
- labeled
- opened
- reopened
- synchronize
- unlabeled

jobs:
check-labels:
name: Check labels
runs-on: ubuntu-22.04
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest # cspell:ignore agilepathway
with:
any_of: >-
🐛 Bug,✨ Feature,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX
none_of: Epic,💫 Good first issue
repo_token: ${{ secrets.GITHUB_TOKEN }}

check-title:
name: Check title
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: npm install @compwa/commitlint-config
- name: Create commitlint config
run: |
echo "module.exports = {extends: ['@compwa/commitlint-config']}" > commitlint.config.js
- uses: JulienKode/[email protected] # cspell:ignore kode
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly
skip:
- taplo

repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.0rc3
hooks:
- id: check-dev-files
args:
- --ignore-author
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-python
- --no-version-branches
- --repo-name=mirrors-taplo

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place
38 changes: 19 additions & 19 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
- id: taplo
name: taplo-cli
description: "A TOML toolkit written in Rust"
entry: taplo format
language: rust
types: [toml]
args: []
require_serial: false
additional_dependencies: ["cli:taplo-cli:0.8.1"]
minimum_pre_commit_version: "0"
- id: taplo
name: taplo-cli
description: "A TOML toolkit written in Rust"
entry: taplo format
language: rust
types: [toml]
args: []
require_serial: false
additional_dependencies: ["cli:taplo-cli:0.8.1"]
minimum_pre_commit_version: "0"

- id: taplo-docker
name: taplo-cli-docker
description: "A TOML toolkit written in Rust"
entry: tamasfe/taplo:0.8.1
language: docker_image
types: [toml]
args: [format]
require_serial: false
minimum_pre_commit_version: "0"
- id: taplo-docker
name: taplo-cli-docker
description: "A TOML toolkit written in Rust"
entry: tamasfe/taplo:0.8.1
language: docker_image
types: [toml]
args: [format]
require_serial: false
minimum_pre_commit_version: "0"
9 changes: 8 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"ms-python.python",
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"stkb.rewrap"
],
"unwantedRecommendations": [
"davidanson.vscode-markdownlint",
"travisillig.vscode-json-stable-stringify"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"[git-commit]": {
"editor.rulers": [72],
"rewrap.wrappingColumn": 72
},
"editor.formatOnSave": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"rewrap.wrappingColumn": 88
}
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "__fake_crate"
version = "0.0.0"

[[bin]]
name = "__fake_cmd"
path = "main.rs"

[package]
name = "__fake_crate"
version = "0.0.0"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04

RUN apt-get update \
RUN apt-get update \
&& apt-get install -y \
curl \
git \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Taplo mirror

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Mirror of [Taplo](https://github.com/tamasfe/taplo) for [pre-commit](https://pre-commit.com), created with a modified version of [`pre-commit-mirror-maker`](https://github.com/pre-commit/pre-commit-mirror-maker) (see [this workflow](./.github/workflows/update-tags.yml)).

### Using Taplo with pre-commit
Expand Down

0 comments on commit 96b1969

Please sign in to comment.