Skip to content

Commit

Permalink
Merge pull request #2 from kjmeagher/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
autoupdate pre-commit hooks
  • Loading branch information
kjmeagher authored Apr 4, 2024
2 parents f4fde25 + d91dc56 commit d02a427
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
# SPDX-License-Identifier: BSD-2-Clause

name: Tests
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
jobs:
Tests:
runs-on: ${{ matrix.os }}
Expand Down
15 changes: 6 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.3.5
hooks:
- id: ruff
args: [--fix]
args: [--fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/pycqa/pylint
rev: v3.0.3
rev: v3.1.0
hooks:
- id: pylint
files: ehist
args: [--ignore=E401]
additional_dependencies: [numpy, matplotlib]
- repo: https://github.com/fsfe/reuse-tool
rev: v2.1.0
rev: v3.0.1
hooks:
- id: reuse
- repo: https://github.com/codespell-project/codespell
Expand All @@ -37,7 +34,7 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: forbid-tabs
Expand Down
1 change: 1 addition & 0 deletions ehist/bayesian_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
.. [1] https://ui.adsabs.harvard.edu/abs/2013ApJ...764..167S
.. [2] https://www.astroml.org/ https://github.com//astroML/astroML/
"""

import warnings
from inspect import signature

Expand Down
4 changes: 3 additions & 1 deletion tests/test_hist1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: BSD-2-Clause

import functools
import operator
import unittest

import numpy as np
Expand All @@ -20,7 +22,7 @@ def quadratic(x, a, b, c):

class TestAxis(unittest.TestCase):
def test_integer(self):
v = sum([i * [i] for i in range(10)], [])
v = functools.reduce(operator.iadd, [i * [i] for i in range(10)], [])
h = Hist1D(v)
assert_allclose(h.N, range(1, 10))
assert_allclose(h.H, range(1, 10))
Expand Down

0 comments on commit d02a427

Please sign in to comment.