Skip to content

Commit e7ae042

Browse files
authored
Merge pull request NeuralEnsemble#1376 from alejoe91/black-formatting-action
Add black-formatting action
2 parents e8f0b12 + d4b83a6 commit e7ae042

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Black formatting
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 12 * * 0" # Weekly at noon UTC on Sundays
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Check and apply black formatting
16+
id: black-check
17+
uses: psf/black@stable
18+
with:
19+
options: "--check --verbose"
20+
continue-on-error: true
21+
22+
- name: Create PR
23+
uses: peter-evans/create-pull-request@v5
24+
if : ${{ steps.black-check.outcome == 'failure' }}
25+
with:
26+
commit-message: black formatting
27+
title: Black formatting
28+
body: Reformatting code with black style
29+
branch: black-formatting

.github/workflows/io-test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data.outputs.dataset_hash }}
4747
restore-keys: ${{ runner.os }}-datasets-
4848

49-
- uses: conda-incubator/setup-miniconda@v2.2.0
49+
- uses: conda-incubator/setup-miniconda@v3
5050
with:
5151
activate-environment: neo-test-env
52-
python-version: ${{ matrix.python-version }}
52+
python-version: "${{ matrix.python-version }}"
5353

5454
- name: Get current dependencies hash
5555
id: dependencies
@@ -81,6 +81,11 @@ jobs:
8181
git config --global user.email "neo_ci@fake_mail.com"
8282
git config --global user.name "neo CI"
8383
84+
- name: Python version
85+
run: |
86+
which python
87+
python --version
88+
8489
- name: Install neo including dependencies
8590
# installation with dependencies is only required if no cache was found
8691
# restore-key hits should result in `cache-hit` == 'false'

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test = [
6262
"coverage",
6363
"coveralls",
6464
"pillow",
65-
"sonpy",
65+
"sonpy;python_version<'3.10'",
6666
"pynwb",
6767
"probeinterface",
6868
"zugbruecke>=0.2",
@@ -84,7 +84,8 @@ docs = [
8484

8585
dev = [
8686
"build",
87-
"twine"
87+
"twine",
88+
"black"
8889
]
8990

9091
igorproio = ["igor2"]
@@ -125,3 +126,7 @@ all = [
125126
"zugbruecke>=0.2; sys_platform!='win32'",
126127
]
127128
# we do not include 'stfio' in 'all' as it is not pip installable
129+
130+
131+
[tool.black]
132+
line-length = 120

0 commit comments

Comments
 (0)