Skip to content

Commit

Permalink
apply formatting and updates makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBarberini committed Nov 7, 2024
1 parent d726d28 commit 9fd33f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
format: flake8 pylint ruff black

black:
black ./lib && black ./tests
black ./lib || true
black ./tests || true

flake8:
flake8 --ignore E501,E402,F401,W503,C0414 ./lib && flake8 --ignore E501,E402,F401,W503,C0414 ./tests
flake8 --ignore E501,E402,F401,W503,C0414 ./lib || true
flake8 --ignore E501,E402,F401,W503,C0414 ./tests || true

pylint:
pylint --extension-pkg-whitelist='pydantic' ./lib && pylint --extension-pkg-whitelist='pydantic' ./tests
pylint --extension-pkg-whitelist='pydantic' ./lib || true
pylint --extension-pkg-whitelist='pydantic' --disable=E0401,W0621 ./tests || true

ruff:
ruff check --fix ./lib || true
Expand Down
4 changes: 3 additions & 1 deletion lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ def parse_error(error):
return f"{exc_type}: {exc_obj}"


from lib.api import app as app # pylint: disable=wrong-import-position,cyclic-import
from lib.api import ( # pylint: disable=wrong-import-position,cyclic-import,useless-import-alias
app as app,
)
6 changes: 3 additions & 3 deletions tests/test_routes/test_environment_route.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest.mock import patch
import pytest
from fastapi.testclient import TestClient
from unittest.mock import patch
from lib.models.environment import Env
from lib.controllers.environment import EnvController
from lib.views.environment import (
Expand All @@ -24,7 +24,7 @@ def mock_env_summary():
return EnvSummary()


def test_create_env(mock_env):
def test_create_env():
with patch.object(
EnvController, "create_env", return_value=EnvCreated(env_id="123")
) as mock_create_env:
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_simulate_env(mock_env_summary):
mock_simulate_env.assert_called_once_with("123")


def test_read_rocketpy_env(mock_env):
def test_read_rocketpy_env():
with patch.object(
EnvController, "get_rocketpy_env_binary", return_value=b'rocketpy'
) as mock_read_rocketpy_env:
Expand Down

0 comments on commit 9fd33f3

Please sign in to comment.