Skip to content

Commit

Permalink
feat: add tests and code checking using tox
Browse files Browse the repository at this point in the history
  • Loading branch information
AiroPi committed Aug 8, 2022
1 parent 17a9591 commit a6e1e2a
Show file tree
Hide file tree
Showing 12 changed files with 979 additions and 908 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
venv/
venv/
.pytest_cache/
.tox/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
.devcontainer/
.env

/cogs/tests.py
.pytest_cache/
.tox/
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[tool.tox] # A better implementation is planned. But this avoid to have an additional `tox.ini` file.
legacy_tox_ini = """
[tox]
skipsdist = true
[testenv]
deps =
-r requirements.txt
-r requirements_dev.txt
commands =
pytest
pyright src/
black --check src/
bandit -r src/ tests/ -c pyproject.toml
isort ./src/ --check
"""

[tool.bandit.assert_used]
skips = ["*/test_*.py", "*/test_*.py"]

[tool.pytest.ini_options]
pythonpath = ". src"

[tool.black]
line-length = 120

[tool.isort]
profile = "black"
combine_as_imports = true
combine_star = true
line_length = 120

[tool.pyright]
6 changes: 6 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pytest>=7.1.2
pyright>=1.1.266
black>=22.6.0
bandit>=1.7.4
isort>=5.10.1
toml>=0.10.2
Loading

0 comments on commit a6e1e2a

Please sign in to comment.