Ver a proveniência

Run the linters on a consistent list of files (#9038)

We were running some linters on some files and some on others. Extract a common
setting and use it everywhere.
tags/v1.26.0rc1
Richard van der Hoff há 3 anos
committed by GitHub
ascendente
cometimento
23a59d24ae
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: 4AEE18F83AFDEB23
6 ficheiros alterados com 24 adições e 17 eliminações
  1. +1
    -0
      .buildkite/scripts/create_postgres_db.py
  2. +1
    -0
      changelog.d/9038.misc
  3. +1
    -10
      stubs/frozendict.pyi
  4. +3
    -3
      stubs/sortedcontainers/sorteddict.pyi
  5. +1
    -1
      stubs/txredisapi.pyi
  6. +17
    -3
      tox.ini

+ 1
- 0
.buildkite/scripts/create_postgres_db.py Ver ficheiro

@@ -15,6 +15,7 @@
# limitations under the License.

import logging

from synapse.storage.engines import create_engine

logger = logging.getLogger("create_postgres_db")


+ 1
- 0
changelog.d/9038.misc Ver ficheiro

@@ -0,0 +1 @@
Configure the linters to run on a consistent set of files.

+ 1
- 10
stubs/frozendict.pyi Ver ficheiro

@@ -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.


+ 3
- 3
stubs/sortedcontainers/sorteddict.pyi Ver ficheiro

@@ -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,


+ 1
- 1
stubs/txredisapi.pyi Ver ficheiro

@@ -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): ...


+ 17
- 3
tox.ini Ver ficheiro

@@ -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 =
@@ -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


Carregando…
Cancelar
Guardar