Skip to content

Commit 53985ff

Browse files
docktermjkernelsam
andauthored
#258 Disable lint issues (#285)
* #258 Disable lint issues * #258 Disable lint issues - 2 * #259 Fix linting issues - 1 * #259 Fix linting issues - 2 * #259 Fix linting issues - 3 * #259 Fix linting issues - 4 * #259 Fix linting issues - 5 * #259 Fix linting issues - 6 * #259 Fix linting issues -7 * #259 Fix linting issues - 8 * Update Bandit GitHub Action configuration * Simplify Bandit workflow by removing setup steps Removed unnecessary steps for checking out the repository and setting up Python in the Bandit workflow. * Fix YAML syntax for Bandit scan targets * Fix indentation for Bandit scan targets * #258 change source directory --------- Co-authored-by: Sam <109683132+kernelsam@users.noreply.github.com>
1 parent 120afc7 commit 53985ff

14 files changed

Lines changed: 85 additions & 35 deletions

File tree

.flake8

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[flake8]
22
extend-ignore =
3-
# E203 and E704 needed for black
3+
# E203 and E704 needed for black
44
E203,
5-
E704,
65
E501,
6+
E704,
7+
F401,
8+
F541,
9+
F821,
10+
F841,
711
W503
812
max-line-length=88

.github/linters/bearer.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
rule:
2-
skip-rule: []
2+
skip-rule:
3+
- python_lang_os_command_injection
4+
- python_lang_path_traversal
5+
- python_lang_path_using_user_input
6+
- python_lang_sql_injection
7+
- python_lang_weak_random

.github/workflows/bandit.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,16 @@ permissions: {}
1111
jobs:
1212
bandit:
1313
permissions:
14-
contents: read
15-
pull-requests: write
14+
security-events: write
1615
runs-on: ubuntu-latest
1716
strategy:
1817
fail-fast: false
1918
matrix:
2019
python-version: ["3.12"]
2120

2221
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@v5
25-
with:
26-
persist-credentials: false
27-
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v6
30-
with:
31-
python-version: ${{ matrix.python-version }}
32-
3322
- name: Run Bandit Scan
34-
uses: lukehinds/bandit-action@new-action
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
uses: PyCQA/bandit-action@v1
3724
with:
38-
path: "sz_tools"
39-
recursive: "true"
25+
python-version: ${{ matrix.python-version }}
26+
targets: sz_tools

.github/workflows/flake8.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ jobs:
3434
uses: py-actions/flake8@v2
3535
with:
3636
max-line-length: 88
37-
path: src
37+
path: sz_tools
3838
plugins: flake8-black

.vscode/cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@
279279
"shuff",
280280
"shutil",
281281
"SIGALRM",
282+
"simplifiable",
282283
"SKYBLUE",
283284
"sourcedict",
284285
"splitext",
@@ -345,4 +346,4 @@
345346
"data/**",
346347
"development-requirements.txt"
347348
]
348-
}
349+
}

development-requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
bandit==1.8.6
22
black==25.9.0
33
build==1.3.0
4-
coverage==7.11.0
4+
coverage==7.10.7
55
flake8==7.3.0
66
fpvs==0.3.0
7-
isort==7.0.0
7+
isort==6.1.0
88
mypy==1.18.2
99
psutil==7.1.1
10-
pylint==4.0.2
10+
pylint==3.3.9
1111
pytest-cov==7.0.0
1212
pytest-schema==0.1.2
1313
pytest==8.4.2
14-
sphinx-autodoc-typehints==3.5.2
15-
sphinx-gallery==0.19.0
14+
sphinx-autodoc-typehints
15+
sphinx-gallery
1616
sphinx-jinja2-compat==0.4.1
17-
sphinx-prompt==1.10.1
17+
sphinx-prompt
1818
sphinx-rtd-theme==3.0.2
1919
sphinx-tabs==3.4.*
2020
sphinx-toolbox==4.0.0
21-
sphinx==8.2.3
21+
sphinx
2222
sphinxcontrib-applehelp==2.0.0
2323
sphinxcontrib-devhelp==2.0.0
2424
sphinxcontrib-htmlhelp==2.1.0

pyproject.toml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ build-backend = "setuptools.build_meta"
99
test = ["pytest", "coverage"]
1010

1111
[tool.bandit]
12-
skips = ["B101"]
12+
skips = [
13+
"B101",
14+
"B108",
15+
"B404",
16+
"B602",
17+
"B605",
18+
"B608"
19+
]
1320

1421
[tool.black]
1522
line-length = 120
@@ -24,6 +31,19 @@ src_paths = ["examples", "src", "tests"]
2431

2532
[tool.mypy]
2633
exclude = ['.venv', 'g2_tools']
34+
disable_error_code = [
35+
"arg-type",
36+
"attr-defined",
37+
"import-not-found",
38+
"name-defined",
39+
"no-untyped-call",
40+
"no-untyped-def",
41+
"return-value",
42+
"union-attr",
43+
"unused-ignore",
44+
"var-annotated"
45+
]
46+
disallow_untyped_defs = false
2747

2848
[[tool.mypy.overrides]]
2949
module = "senzing_abstract.szengineflags.*"
@@ -34,16 +54,41 @@ warn_unused_ignores = "false"
3454
module = "pytest_schema.*"
3555
ignore_missing_imports = "true"
3656

57+
[[tool.mypy.overrides]]
58+
module = "sz_tools/_sz_database"
59+
ignore_missing_imports = "true"
60+
3761
[tool.pylint]
3862
ignored-argument-names = "args|kwargs"
3963
disable = [
4064
"broad-except",
65+
"broad-exception-raised",
66+
"consider-iterating-dictionary",
67+
"consider-using-dict-items",
4168
"consider-using-f-string",
69+
"consider-using-generator",
70+
"f-string-without-interpolation",
71+
"invalid-name",
72+
"line-too-long",
4273
"line-too-long",
74+
"missing-class-docstring",
75+
"missing-function-docstring",
76+
"missing-module-docstring",
77+
"no-member",
78+
"protected-access",
79+
"raise-missing-from",
80+
"simplifiable-if-expression",
4381
"too-many-branches",
4482
"too-many-instance-attributes",
4583
"too-many-locals",
46-
"too-many-statements"
84+
"too-many-statements",
85+
"undefined-variable",
86+
"unidiomatic-typecheck",
87+
"unspecified-encoding",
88+
"unused-argument",
89+
"unused-import",
90+
"unused-variable",
91+
"useless-return"
4792
]
4893
good-names = [
4994
"template-python"

setup.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[metadata]
2-
name = python-tools
2+
name = sz-python-tools
33
version = 0.0.31
44
author = senzing
55
author_email = support@senzing.com
6-
description = Python Tools
6+
description = Senzing Python Tools
77
license = Apache 2
88
long_description = file: README.md
99
long_description_content_type = text/markdown
@@ -12,12 +12,11 @@ project_urls =
1212
Bug Tracker = https://github.com/senzing-garage/sz-python-tools/issues
1313
classifiers =
1414
Programming Language :: Python :: 3
15-
License :: OSI Approved :: Apache Software License
1615
Operating System :: OS Independent
1716

1817
[options]
1918
package_dir =
20-
= src
19+
= sz_tools
2120
packages = find:
2221
python_requires = >=3.9
2322
install_requires =

testdata/senzing-license/g2.lic

1.07 KB
Binary file not shown.

testdata/sqlite/G2C-empty.db

Whitespace-only changes.

0 commit comments

Comments
 (0)