You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python/JavaScript scientific: the library name has no left boundary (import my_numpy, ./my-numpy) and the match spans the whole line #9453
Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).
Construct: the scientific rule in python.py and javascript.py is the same pattern, \b(?:import|require|from)\b.*?(?:numpy|pandas|scipy|matplotlib|opencv|cv2)\b. The library name has no left boundary and .*? spans the whole line, so any identifier or path that merely ENDS in a library name, anywhere later on a line that contains the word import/from/require, counts.
Snippets and actual hits (expected 0 each):
python import my_numpy -> 1
python from mypandas import x -> 1
python import my_cv2 -> 1
javascript import x from "./my-numpy"; -> 1
javascript import { my_numpy } from "./x"; -> 1
javascript const from = 1; const c = cv2; -> 1 (a variable named from, then a use of cv2)
Positive controls import numpy as np (python) and import cv from "@techstark/opencv-js"; (javascript) fire as they should.
Rules: gitgalaxy/standards/language_standards/languages/python.py and javascript.py, scientific. The python import rule was anchored to statement position for the same kind of reason (#2875 C5); scientific was not.
Locked in tests/decoys/test_decoy_python.py and tests/decoys/test_decoy_javascript.py as xfail(strict=True).
Activity
tests/decoys: SOP-002 gap-cell decoy suites for python, typescript, j…