Skip to content

Commit

Permalink
chore: add pre-commit formatters for toml and yaml (#1002)
Browse files Browse the repository at this point in the history
* add pre-commit formatters for toml and yaml

* style: pre-commit fixes

* add yaml offset

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jim Pivarski <jpivarski@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 19, 2023
1 parent 9d5e97e commit f422551
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 177 deletions.
18 changes: 9 additions & 9 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: "Start a discussion (GitHub)"
about: "How do I…?"
url: https://github.com/scikit-hep/uproot5/discussions
- name: "StackOverflow: [uproot] tag"
about: "How do I…?"
url: https://stackoverflow.com/questions/tagged/uproot
- name: "Gitter: Scikit-HEP/uproot room"
about: "Getting help in real-time…"
url: https://gitter.im/Scikit-HEP/uproot
- name: Start a discussion (GitHub)
about: How do I…?
url: https://github.com/scikit-hep/uproot5/discussions
- name: 'StackOverflow: [uproot] tag'
about: How do I…?
url: https://stackoverflow.com/questions/tagged/uproot
- name: 'Gitter: Scikit-HEP/uproot room'
about: Getting help in real-time…
url: https://gitter.im/Scikit-HEP/uproot
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
interval: weekly
46 changes: 23 additions & 23 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "Test build"
name: Test build

on:
workflow_dispatch:
pull_request:
push:
branches: ["main"]
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -15,46 +15,46 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: ["windows-latest", "macos-latest", "ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

runs-on: "${{ matrix.platform }}"
runs-on: ${{ matrix.platform }}
timeout-minutes: 30

# Required for miniconda to activate conda
defaults:
run:
shell: "bash -l {0}"
shell: bash -l {0}

steps:
- uses: "actions/checkout@v4"
- uses: actions/checkout@v4

- name: "Get conda"
uses: "conda-incubator/setup-miniconda@v2"
- name: Get conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
use-mamba: true

- name: "Install ROOT"
if: "matrix.python-version == 3.8 && runner.os != 'macOS' && runner.os != 'Windows'"
- name: Install ROOT
if: matrix.python-version == 3.8 && runner.os != 'macOS' && runner.os != 'Windows'
run: |
conda env list
mamba install root
conda list
- name: "Install XRootD"
if: "runner.os != 'macOS' && runner.os != 'Windows'"
- name: Install XRootD
if: runner.os != 'macOS' && runner.os != 'Windows'
run: |
conda env list
mamba install xrootd
conda list
- name: "Pip install the package"
- name: Pip install the package
run: python -m pip install .[test,dev]

- name: "Run pytest"
- name: Run pytest
run: |
python -m pytest -vv tests \
--reruns 3 --reruns-delay 30 \
Expand All @@ -64,22 +64,22 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: ["3.11"]
platform: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.11']

runs-on: "${{ matrix.platform }}"
runs-on: ${{ matrix.platform }}
timeout-minutes: 30

steps:
- uses: "actions/checkout@v4"
- uses: actions/checkout@v4

- uses: "actions/setup-python@v4"
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
python-version: ${{ matrix.python-version }}

- name: "Pip install the package"
- name: Pip install the package
run: python -m pip install .[test,dev]

- name: "Run pytest"
- name: Run pytest
run: |
python -m pytest -vv tests --reruns 3 --reruns-delay 30 --only-rerun requests.exceptions.HTTPError
34 changes: 17 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ on:
workflow_dispatch:
release:
types:
- published
- published

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Build wheel and SDist
run: pipx run build
- name: Build wheel and SDist
run: pipx run build

- name: Check metadata
run: pipx run twine check dist/*
- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v3
with:
path: dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*


publish:
Expand All @@ -29,11 +29,11 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: Lint PR

on:
pull_request:
Expand Down
66 changes: 37 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"
autoupdate_commit_msg: 'chore: update pre-commit hooks'
autofix_commit_msg: 'style: pre-commit fixes'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.292"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
hooks:
- id: ruff
args: [--fix, --show-fixes]


- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
hooks:
- id: pretty-format-toml
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix, --indent, '2', --offset, '2']
Loading

0 comments on commit f422551

Please sign in to comment.