Skip to content

Commit 925bb83

Browse files
Merge pull request #1433 from cclauss/patch-1
Fix failing tests again
2 parents bffbaa5 + 52ed856 commit 925bb83

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

.github/workflows/lint_python.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
name: lint_python
2-
on: [push, pull_request]
2+
on: [pull_request, push]
33
jobs:
44
lint_python:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@master
8-
- uses: actions/setup-python@master
9-
- run: pip install black codespell flake8 isort pytest
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v2
9+
- run: pip install --upgrade pip wheel
10+
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
11+
flake8-comprehensions isort mypy pytest pyupgrade safety
12+
- run: bandit --recursive --skip B101 . || true # B101 is assert statements
1013
- run: black --check . || true
11-
- run: codespell --quiet-level=2 || true # --ignore-words-list="" --skip=""
14+
- run: codespell || true # --ignore-words-list="" --skip="*.css,*.js,*.lock"
1215
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
13-
- run: isort --recursive . || true
14-
- run: pip install -r requirements.txt || true
15-
- run: pytest .
16+
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88
17+
--show-source --statistics
18+
- run: isort --check-only --profile black . || true
19+
- run: pip install -r requirements.txt || pip install --editable . || true
20+
- run: mkdir --parents --verbose .mypy_cache
21+
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
22+
- run: pytest . || pytest --doctest-modules .
23+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
24+
- run: safety check

Binary_search.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def binary_search(arr, l, r, x):
1212
# If element is smaller than mid, then it can only
1313
# be present in left subarray
1414
elif arr[mid] > x:
15-
return binarySearch(arr, l, mid - 1, x)
15+
return binary_search(arr, l, mid - 1, x)
1616

1717
# Else the element can only be present in right subarray
1818
else:
19-
return binarySearch(arr, mid + 1, r, x)
19+
return binary_search(arr, mid + 1, r, x)
2020

2121
# If we reach here, then the element was not present
2222
return -1

Python Program to Display Fibonacci Sequence Using Recursion

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nterms = 10
88

99
# check if the number of terms is valid
1010
if nterms <= 0:
11-
print("Plese enter a positive integer")
11+
print("Please enter a positive integer")
1212
else:
1313
print("Fibonacci sequence:")
1414
for i in range(nterms):

0 commit comments

Comments
 (0)