Skip to content

Commit 69a3ff4

Browse files
committed
Using pyflakes to check the code
1 parent 3ec8a23 commit 69a3ff4

2 files changed

Lines changed: 45 additions & 2 deletions

File tree

.github/workflows/cli-smoke.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ jobs:
8282
8383
- name: "Select with a query"
8484
run: |
85-
# beam_current > 5 must match run 100 (12.5) and exclude run 101 (0.0)
86-
OUT=$(rcdb select "beam_current > 5" 100-101)
85+
# beam_current > 5 must match run 100 (12.5) and exclude run 101 (0.0).
86+
# The third arg selects beam_current as a view column, so the actual
87+
# VALUE must appear in the output - not just the run number.
88+
OUT=$(rcdb select "beam_current > 5" 100-101 beam_current)
8789
echo "$OUT"
8890
echo "$OUT" | grep -q "100"
91+
echo "$OUT" | grep -q "12.5" # value column must be populated, not empty
8992
if echo "$OUT" | grep -qw "101"; then
9093
echo "ERROR: run 101 (beam_current=0.0) should not match 'beam_current > 5'"
9194
exit 1
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint (pyflakes)
2+
3+
# Informational only: runs pyflakes over the Python sources and prints the
4+
# findings, but never fails the build. The codebase has known pre-existing
5+
# findings, plus false positives from intentional __init__.py re-exports and
6+
# `from rcdb.model import *`. Use this report to spot newly introduced unused
7+
# imports / undefined names in a pull request diff.
8+
9+
on:
10+
push:
11+
branches: ["*"]
12+
pull_request:
13+
branches: [main]
14+
15+
jobs:
16+
pyflakes:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: "3.12"
26+
27+
# pyflakes is declared in the project's `dev` optional-dependency group,
28+
# so the CI and local developers use the same version.
29+
- name: Install pyflakes
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install "$GITHUB_WORKSPACE/python[dev]"
33+
34+
- name: Run pyflakes (informational, never fails)
35+
run: |
36+
# This is a report, not a gate: always exit 0.
37+
pyflakes python/rcdb python/daq > pyflakes.txt 2>&1 || true
38+
cat pyflakes.txt
39+
echo "--------------------------------------------------"
40+
echo "pyflakes findings: $(wc -l < pyflakes.txt)"

0 commit comments

Comments
 (0)