-
-
Notifications
You must be signed in to change notification settings - Fork 82
53 lines (45 loc) · 1.39 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Lint
on:
push:
branches:
- "*"
pull_request:
branches:
- main
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test_lint:
name: Lint
# If using act to run CI locally the github object does not exist and the usual skipping should not be enforced
if: "github.repository == 'numpy/numpy-financial' || github.repository == ''"
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python packages
run: |
python -m pip install --upgrade pip poetry
poetry env use ${{ matrix.python-version }}
poetry install --with=lint
- name: Lint with Ruff
run: |
set -euo pipefail
# Tell us what version we are using
poetry run ruff version
# Check the source file, ignore type annotations (ANN) for now.
poetry run ruff check numpy_financial/ --ignore F403 --select E,F,B,I
# Check the test and benchmark files
poetry run ruff check tests/ benchmarks/ --select E,F,B,I