Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Run the linters on a consistent list of files #9038

Merged
merged 3 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/scripts/create_postgres_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

import logging

from synapse.storage.engines import create_engine

logger = logging.getLogger("create_postgres_db")
Expand Down
1 change: 1 addition & 0 deletions changelog.d/9038.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Configure the linters to run on a consistent set of files.
11 changes: 1 addition & 10 deletions stubs/frozendict.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@

# Stub for frozendict.

from typing import (
Any,
Hashable,
Iterable,
Iterator,
Mapping,
overload,
Tuple,
TypeVar,
)
from typing import Any, Hashable, Iterable, Iterator, Mapping, Tuple, TypeVar, overload

_KT = TypeVar("_KT", bound=Hashable) # Key type.
_VT = TypeVar("_VT") # Value type.
Expand Down
6 changes: 3 additions & 3 deletions stubs/sortedcontainers/sorteddict.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ from typing import (
Callable,
Dict,
Hashable,
Iterator,
Iterable,
ItemsView,
Iterable,
Iterator,
KeysView,
List,
Mapping,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
Tuple,
Union,
ValuesView,
overload,
Expand Down
2 changes: 1 addition & 1 deletion stubs/txredisapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""Contains *incomplete* type hints for txredisapi.
"""

from typing import List, Optional, Union, Type
from typing import List, Optional, Type, Union

class RedisProtocol:
def publish(self, channel: str, message: bytes): ...
Expand Down
20 changes: 17 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ deps =
# install the "enum34" dependency of cryptography.
pip>=10

# directories/files we run the linters on
lint_targets =
setup.py
synapse
tests
scripts
scripts-dev
stubs
contrib
synctl
synmark
.buildkite
docker

# default settings for all tox environments
[testenv]
deps =
Expand Down Expand Up @@ -130,13 +144,13 @@ commands =
[testenv:check_codestyle]
extras = lint
commands =
python -m black --check --diff .
/bin/sh -c "flake8 synapse tests scripts scripts-dev contrib synctl {env:PEP8SUFFIX:}"
python -m black --check --diff {[base]lint_targets}
flake8 {[base]lint_targets} {env:PEP8SUFFIX:}
{toxinidir}/scripts-dev/config-lint.sh

[testenv:check_isort]
extras = lint
commands = /bin/sh -c "isort -c --df --sp setup.cfg synapse tests scripts-dev scripts"
commands = isort -c --df --sp setup.cfg {[base]lint_targets}

[testenv:check-newsfragment]
skip_install = True
Expand Down