Skip to content

Commit

Permalink
Merge pull request #533 from mkniewallner/cleanup-tooling
Browse files Browse the repository at this point in the history
Cleanup tooling
  • Loading branch information
abusi committed Sep 24, 2021
2 parents 9947c6f + 8a405a8 commit 2caa843
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ omit =
__init__.py

[report]
show_missing = True
show_missing = True
31 changes: 11 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "09:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
reviewers:
- abusi
assignees:
- abusi
ignore:
- dependency-name: pytest-asyncio
versions:
- 0.15.0
- 0.15.1
- dependency-name: pylint
versions:
- 2.7.0
- 2.7.4
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "09:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
reviewers:
- abusi
assignees:
- abusi
6 changes: 0 additions & 6 deletions .isort.cfg

This file was deleted.

126 changes: 126 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
[MASTER]

# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=pylint.extensions.docparams,pylint.extensions.docstyle,pylint.extensions.mccabe


[MESSAGES CONTROL]

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=missing-docstring,
undefined-variable,
locally-disabled,
duplicate-code,
too-few-public-methods,
bad-builtin,
abstract-method,
global-statement,
logging-format-interpolation,
trailing-whitespace,
line-too-long,
cyclic-import,
useless-return,
docstring-first-line-empty,
missing-raises-doc,
raise-missing-from


[REPORTS]

# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
output-format=colorized


[FORMAT]

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '

# Maximum number of characters on a single line.
max-line-length=80

# Maximum number of lines in a module.
max-module-lines=1500


[BASIC]

# Bad variable names which should always be refused, separated by a comma.
bad-names=foo,
bar,
baz,
toto,
tutu,
tata,
coucou

# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style.
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{1,40}|(__.*__))$

# Regular expression matching correct function names. Overrides function-
# naming-style.
function-rgx=[a-z_][a-z0-9_]{2,50}$

# Good variable names which should always be accepted, separated by a comma.
good-names=_,
__,
___,
e,
i,
j,
k,
sq,
fn,
fh,
js,
ts,
rx,
logger

# Regular expression matching correct method names. Overrides method-naming-
# style.
method-rgx=[a-z_][a-z0-9_]{2,50}$


[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
NINJA


[DESIGN]

# Maximum number of arguments for function / method.
max-args=10

# Maximum number of attributes for a class (see R0902).
max-attributes=15

# Maximum number of branch for function / method body.
max-branches=12

# Maximum number of locals for function / method body.
max-locals=15

# Maximum number of public methods for a class (see R0904).
max-public-methods=30

# Maximum number of return / yield for function / method body.
max-returns=10

# Maximum number of statements in function / method body.
max-statements=100
24 changes: 9 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,47 @@
.PHONY: init
init:
git submodule init
git submodule update
git submodule update --init

.PHONY: install
install: init
pip install -e .[test]

.PHONY: format-import
format-import:
isort --profile black tartiflette/. tests/. setup.py
isort tartiflette/. tests/. setup.py

.PHONY: format
format: format-import
black -l 79 --target-version py36 tartiflette tests setup.py
black tartiflette tests setup.py

.PHONY: check-import
check-import:
isort --check-only --profile black tartiflette/. tests/. setup.py
isort --check-only tartiflette/. tests/. setup.py

.PHONY: check-format
check-format:
black -l 79 --target-version py36 --check tartiflette tests setup.py
black --check tartiflette tests setup.py

.PHONY: style
style: check-format check-import
pylint tartiflette --rcfile=pylintrc

.PHONY: test-integration
test-integration: clean
true
pylint tartiflette --rcfile=.pylintrc

.PHONY: test-unit
test-unit: clean
mkdir -p reports
py.test -s tests/unit --junitxml=reports/report_unit_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_func.xml $(EXTRA_ARGS)
pytest -s tests/unit --junitxml=reports/report_unit_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_func.xml $(EXTRA_ARGS)

.PHONY: test-functional
test-functional: clean
mkdir -p reports
py.test -s tests/functional --junitxml=reports/report_func_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_unit.xml $(EXTRA_ARGS)
pytest -s tests/functional --junitxml=reports/report_func_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_unit.xml $(EXTRA_ARGS)

.PHONY: test
test: test-integration test-unit test-functional
test: test-unit test-functional

.PHONY: clean
clean:
find . -name '*.pyc' -exec rm -fv {} +
find . -name '*.pyo' -exec rm -fv {} +
find . -name '__pycache__' -exec rm -frv {} +

.PHONY: set-dev-version
Expand Down
35 changes: 0 additions & 35 deletions bin/sdl_cli.py

This file was deleted.

77 changes: 0 additions & 77 deletions pylintrc

This file was deleted.

13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tool.black]
line_length = 79
target-version = ["py36"]

[tool.isort]
profile = "black"
line_length = 79
known_first_party = [
"tartiflette",
"tests"
]
combine_as_imports = true
lines_between_types = 1

0 comments on commit 2caa843

Please sign in to comment.