diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 10f6833..598a8e7 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,7 +13,7 @@ permissions: contents: read jobs: - build: + quality: runs-on: ubuntu-latest steps: @@ -21,19 +21,20 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.x" + python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install isort - pip install black - pip install flake8 - pip install pytest - pip install pandas - pip install pandas-stubs - - name: Run isort - run: isort . --check-only --diff - - name: Run black - run: black . --check - - name: Run flake8 - run: flake8 + pip install black flake8 isort bandit safety pytest-cov + pip install -r requirements.txt + - name: Check formatting + run: | + black . --check + isort . --check-only --diff + - name: Lint + run: | + flake8 . --count --statistics + bandit -r . + - name: Security check + run: | + safety check diff --git a/pyproject.toml b/pyproject.toml index 8255a02..87c98de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,20 +8,6 @@ profile = "black" multi_line_output = 3 py_version = 311 -[tool.mypy] -python_version = "3.11" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = true -check_untyped_defs = true -disallow_incomplete_defs = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_no_return = true -warn_unreachable = true -packages = ["fingpt_trader"] - [tool.bandit] exclude_dirs = ["tests", "venv", ".git", "__pycache__"] skips = ["B101", "B104"] # Skip assert statements and hardcoded bind @@ -33,6 +19,24 @@ skips = ["test_*.py"] [tool.bandit.hardcoded_bind_all_interfaces] skips = ["start_bot.py"] +[tool.flake8] +max-line-length = 88 +extend-ignore = E203, W503 +exclude = .git,__pycache__,venv,tests, dist + +[coverage:run] +branch = True +source = fingpt_trader + +[coverage:report] +show_missing = True +skip_covered = True +fail_under = 100 +exclude_lines = + pragma: no cover + def __repr__ + raise NotImplementedError + [build-system] requires = ["setuptools>=45", "wheel"] build-backend = "setuptools.build_meta"