chore: enable trailing-whitespace and cleanup (#3847)

* enable trailing-whitespace

* remove trailing whitespace on rest api too
This commit is contained in:
ZanSara 2023-01-11 20:08:19 +01:00 committed by GitHub
parent fa4404baa0
commit 4cbc8550d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 40 deletions

View File

@ -1,50 +1,50 @@
FLOWERS = r"""
vVVVv vVVVv
vVVVv vVVVv
(___) vVVVv (___) vVVVv
~Y~ (___) ~Y~ (___)
\| \~Y~/ \| \~Y~/
\\|// \\|// \\|// \\|//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"""
SAMPLE = r"""
.--. _____ _
.'_\/_'. / ____| | |
'. /\ .' | (___ __ _ _ __ ___ _ __ | | ___
"||" \___ \ / _` | '_ ` _ \| '_ \| |/ _ \
.--. _____ _
.'_\/_'. / ____| | |
'. /\ .' | (___ __ _ _ __ ___ _ __ | | ___
"||" \___ \ / _` | '_ ` _ \| '_ \| |/ _ \
|| /\ ____) | (_| | | | | | | |_) | | __/
/\ ||//\) |_____/ \__,_|_| |_| |_| .__/|_|\___|
(/\\||/ |_|
______\||/___________________________________________
(/\\||/ |_|
______\||/___________________________________________
"""
FENCE = r"""
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_
-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_
-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-
|_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|
|_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
"""
TRACTOR_SMALL = r"""
TRACTOR_SMALL = r"""
______
|o | !
__ |:`_|---'-.
|__|______.-/ _ \-----.|
(o)(o)------'\ _ / ( )
|__|______.-/ _ \-----.|
(o)(o)------'\ _ / ( )
"""
TRACTOR_WITH_SILO_LINE = r"""
TRACTOR_WITH_SILO_LINE = r"""
____
/____\
______ | |
|o | ! | |
|o | ! | |
__ |:`_|---'-. | |
|__|______.-/ _ \-----.| |______|
(o)(o)------'\ _ / ( ) | |
@ -81,23 +81,23 @@ BUSH_SEP = r"""\\|// \\|// \\|// \\|// \\|//
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"""
WATERING_CAN = r"""
______
_ ,',----.`.
'.`-. .-' '----. ||
`.`-'--------| ;;
`.|--------|//
\ /
'--------'
______
_ ,',----.`.
'.`-. .-' '----. ||
`.`-'--------| ;;
`.|--------|//
\ /
'--------'
"""
WORKER_M = r""" 0
/|\
WORKER_M = r""" 0 # pylint: disable=trailing-whitespace
/|\
/'\ """
WORKER_F = r""" 0
/w\
WORKER_F = r""" 0 # pylint: disable=trailing-whitespace
/w\
/ \ """
WORKER_X = r""" 0
/w\
WORKER_X = r""" 0 # pylint: disable=trailing-whitespace
/w\
/'\ """

View File

@ -53,13 +53,13 @@ class ImageToTextConverter(BaseConverter):
if verify_installation.returncode == 127:
raise Exception(
"""tesseract is not installed.
Installation on Linux:
apt-get install tesseract-ocr libtesseract-dev poppler-utils
Installation on MacOS:
brew install tesseract
For installing specific language packs check here: https://tesseract-ocr.github.io/tessdoc/Installation.html
"""
)

View File

@ -58,14 +58,14 @@ class PDFToTextConverter(BaseConverter):
except FileNotFoundError:
raise FileNotFoundError(
"""pdftotext is not installed. It is part of xpdf or poppler-utils software suite.
Installation on Linux:
wget --no-check-certificate https://dl.xpdfreader.com/xpdf-tools-linux-4.04.tar.gz &&
tar -xvf xpdf-tools-linux-4.04.tar.gz && sudo cp xpdf-tools-linux-4.04/bin64/pdftotext /usr/local/bin
Installation on MacOS:
brew install xpdf
You can find more details here: https://www.xpdfreader.com
"""
)

View File

@ -277,7 +277,6 @@ disable = [
"f-string-without-interpolation",
"abstract-method",
"too-many-branches",
"trailing-whitespace",
"unspecified-encoding",
"unidiomatic-typecheck",
"no-name-in-module",

View File

@ -16,10 +16,8 @@ pipelines = get_pipelines() # Unused here, called to init the pipelines early
logger.info("Open http://127.0.0.1:8000/docs to see Swagger API Documentation.")
logger.info(
"""
Or just try it out directly: curl --request POST --url 'http://127.0.0.1:8000/query'
-H "Content-Type: application/json" --data '{"query": "Who is the father of Arya Stark?"}'
"""
"Or just try it out directly: curl --request POST --url 'http://127.0.0.1:8000/query' "
'-H "Content-Type: application/json" --data \'{"query": "Who is the father of Arya Stark?"}\''
)