Browse Source

Un-pin prospector version

The issues that were causing prospector to break have been fixed, so
this is safe to un-pin now. Required a few config changes and code
updates to fix some new errors that came with the updated versions.
merge-requests/85/head
Deimos 5 years ago
parent
commit
6a7b42dd87
  1. 3
      tildes/prospector.yaml
  2. 2
      tildes/requirements-to-freeze.txt
  3. 10
      tildes/requirements.txt
  4. 3
      tildes/tildes/lib/database.py
  5. 1
      tildes/tildes/lib/message.py
  6. 8
      tildes/tildes/views/login.py

3
tildes/prospector.yaml

@ -9,6 +9,7 @@ pep8:
disable:
# "multiple statements on one line" - type declarations seem to trigger sometimes
- E704
- E203 # whitespace around colons in slices
pep257:
disable:
@ -26,9 +27,11 @@ pylint:
disable:
- bad-continuation # let Black handle line-wrapping
- comparison-with-callable # seems to have a lot of false positives
- cyclic-import # not sure what's triggering this, doesn't seem to work correctly
- logging-fstring-interpolation # rather use f-strings than worry about this
- no-else-return # elif after return - could refactor to enable this check
- no-self-use # schemas do this a lot, would be nice to only disable for schemas
- too-few-public-methods # plenty of classes that don't need multiple methods
- too-many-instance-attributes # models have many instance attributes
- ungrouped-imports # let isort handle this
- unnecessary-pass # I prefer using pass, even when it's not technically necessary

2
tildes/requirements-to-freeze.txt

@ -15,7 +15,7 @@ mypy
mypy-extensions
Pillow
prometheus-client
prospector==1.1.6.2
prospector
psycopg2
publicsuffix2==2.20160818
pygit2

10
tildes/requirements.txt

@ -3,7 +3,7 @@ alembic==1.1.0
amqpy==0.13.1
appdirs==1.4.3
argon2-cffi==19.1.0
astroid==2.0.4
astroid==2.2.5
atomicwrites==1.3.0
attrs==19.1.0
backcall==0.1.0
@ -48,7 +48,7 @@ plaster-pastedeploy==0.7
pluggy==0.13.0
prometheus-client==0.7.1
prompt-toolkit==2.0.9
prospector==1.1.6.2
prospector==1.1.7
psycopg2==2.8.3
ptyprocess==0.6.0
publicsuffix2==2.20160818
@ -59,10 +59,10 @@ pydocstyle==4.0.1
pyflakes==1.6.0
pygit2==0.28.2
Pygments==2.4.2
pylint==2.1.1
pylint==2.3.1
pylint-celery==0.3
pylint-django==2.0.2
pylint-flask==0.5
pylint-django==2.0.10
pylint-flask==0.6
pylint-plugin-utils==0.5
pyotp==2.3.0
pyparsing==2.4.2

3
tildes/tildes/lib/database.py

@ -124,8 +124,7 @@ class ArrayOfLtree(ARRAY): # pylint: disable=too-many-ancestors
return process
# pylint: disable=invalid-name,too-many-ancestors
class comparator_factory(ARRAY.comparator_factory):
class comparator_factory(ARRAY.comparator_factory): # noqa
"""Add custom comparison functions.
The ancestor_of, descendant_of, and lquery functions are supported by LtreeType,

1
tildes/tildes/lib/message.py

@ -2,6 +2,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Functions/constants related to messages."""
# flake8: noqa
WELCOME_MESSAGE_SUBJECT = "Welcome to the Tildes alpha"

8
tildes/tildes/views/login.py

@ -126,12 +126,12 @@ def post_login_two_factor(request: Request, code: str, from_url: str) -> NoRetur
.one_or_none()
)
if user.is_correct_two_factor_code(code):
del request.session["two_factor_username"]
raise finish_login(request, user, from_url)
else:
if not user.is_correct_two_factor_code(code):
raise HTTPUnauthorized(body="Invalid code, please try again.")
del request.session["two_factor_username"]
raise finish_login(request, user, from_url)
@view_config(route_name="logout", request_method="POST")
def post_logout(request: Request) -> HTTPFound:

Loading…
Cancel
Save