codespell --quiet-level=2 (#1711)

* codespell --quiet-level=2

Suppress the BINARY FILE warnings

* fixup! Format Python code with psf/black push
This commit is contained in:
Christian Clauss 2020-01-23 17:21:51 +01:00 committed by John Law
parent 2cf7e8f994
commit 46ac50a28e
5 changed files with 37 additions and 26 deletions

View File

@ -10,5 +10,5 @@ jobs:
- uses: actions/setup-python@v1
- run: pip install codespell flake8
- run: |
SKIP="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt,*.bak,*.gif,*.jpeg,*.jpg,*.json,*.png,*.pyc"
codespell -L ans,fo,hist,iff,secant,tim --skip=$SKIP
SKIP="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt"
codespell -L ans,fo,hist,iff,secant,tim --skip=$SKIP --quiet-level=2

View File

@ -4,10 +4,13 @@ Approximates the area under the curve using the trapezoidal rule
from typing import Callable, Union
def trapezoidal_area(fnc: Callable[[Union[int, float]], Union[int, float]],
def trapezoidal_area(
fnc: Callable[[Union[int, float]], Union[int, float]],
x_start: Union[int, float],
x_end: Union[int, float],
steps: int = 100) -> float:
steps: int = 100,
) -> float:
"""
Treats curve as a collection of linear lines and sums the area of the
trapezium shape they form
@ -44,6 +47,7 @@ def trapezoidal_area(fnc: Callable[[Union[int, float]], Union[int, float]],
if __name__ == "__main__":
def f(x):
return x ** 3 + x ** 2

View File

@ -37,7 +37,7 @@ def armstrong_number(n: int) -> bool:
temp = n
while temp > 0:
rem = temp % 10
sum += (rem ** number_of_digits)
sum += rem ** number_of_digits
temp //= 10
return n == sum
@ -50,7 +50,7 @@ def main():
print(f"{num} is {'' if armstrong_number(num) else 'not '}an Armstrong number.")
if __name__ == '__main__':
if __name__ == "__main__":
import doctest
doctest.testmod()

View File

@ -1,10 +1,13 @@
from typing import Callable, Union
import math as m
def line_length(fnc: Callable[[Union[int, float]], Union[int, float]],
def line_length(
fnc: Callable[[Union[int, float]], Union[int, float]],
x_start: Union[int, float],
x_end: Union[int, float],
steps: int = 100) -> float:
steps: int = 100,
) -> float:
"""
Approximates the arc length of a line segment by treating the curve as a
@ -48,6 +51,7 @@ def line_length(fnc: Callable[[Union[int, float]], Union[int, float]],
return length
if __name__ == "__main__":
def f(x):

View File

@ -4,10 +4,13 @@ Approximates the area under the curve using the trapezoidal rule
from typing import Callable, Union
def trapezoidal_area(fnc: Callable[[Union[int, float]], Union[int, float]],
def trapezoidal_area(
fnc: Callable[[Union[int, float]], Union[int, float]],
x_start: Union[int, float],
x_end: Union[int, float],
steps: int = 100) -> float:
steps: int = 100,
) -> float:
"""
Treats curve as a collection of linear lines and sums the area of the