From 3ee38fecdcf3e8fe2058362c70aa4d57ba8b2ab0 Mon Sep 17 00:00:00 2001 From: Ikem Peter Date: Thu, 24 Oct 2024 14:11:30 +0100 Subject: [PATCH 1/2] fixed: fixed all pylint errors --- web_app/alembic/env.py | 8 +++ ..._rename_deployed_contract_hash_and_add_.py | 52 ++++++++++++++++++- ...1e3e800f_create_user_and_position_table.py | 12 +++++ web_app/api/dashboard.py | 7 ++- web_app/api/main.py | 13 ++++- web_app/api/position.py | 36 +++++++++++-- web_app/api/serializers/dashboard.py | 27 ++++++++++ web_app/api/serializers/position.py | 4 ++ web_app/api/serializers/transaction.py | 16 ++++++ web_app/api/serializers/user.py | 13 +++++ web_app/api/user.py | 44 ++++++++++++++-- web_app/contract_tools/api_request.py | 7 +++ web_app/contract_tools/blockchain_call.py | 12 ++++- web_app/contract_tools/constants.py | 8 ++- web_app/contract_tools/mixins/dashboard.py | 7 ++- web_app/contract_tools/mixins/deposit.py | 7 ++- web_app/contract_tools/utils.py | 7 ++- web_app/db/crud.py | 7 ++- web_app/db/database.py | 4 ++ web_app/db/models.py | 11 ++++ web_app/tests/conftest.py | 4 ++ web_app/tests/test_user.py | 4 ++ 22 files changed, 290 insertions(+), 20 deletions(-) diff --git a/web_app/alembic/env.py b/web_app/alembic/env.py index 59b734c3..8b544686 100644 --- a/web_app/alembic/env.py +++ b/web_app/alembic/env.py @@ -1,3 +1,11 @@ +""" +Alembic migration environment configuration. + +This module sets up the environment for Alembic database migrations, +including database URL configuration, logging setup, and migration +execution modes (online and offline). It integrates with SQLAlchemy models +and provides the core functionality needed for database schema version control. +""" from logging.config import fileConfig from sqlalchemy import engine_from_config diff --git a/web_app/alembic/versions/b705d1435b64_rename_deployed_contract_hash_and_add_.py b/web_app/alembic/versions/b705d1435b64_rename_deployed_contract_hash_and_add_.py index c5b80dda..0dcc60e3 100644 --- a/web_app/alembic/versions/b705d1435b64_rename_deployed_contract_hash_and_add_.py +++ b/web_app/alembic/versions/b705d1435b64_rename_deployed_contract_hash_and_add_.py @@ -19,12 +19,29 @@ def column_exists(table_name: str, column_name: str) -> bool: + """Check if a column exists in the specified table. + + Args: + table_name (str): Name of the table to check + column_name (str): Name of the column to look for + + Returns: + bool: True if the column exists, False otherwise + """ bind = op.get_bind() inspector = Inspector.from_engine(bind) columns = [column.get('name') for column in inspector.get_columns(table_name)] return column_name in columns def enum_type_exists(enum_name: str) -> bool: + """Check if an enum type exists in the database. + + Args: + enum_name (str): Name of the enum type to check + + Returns: + bool: True if the enum type exists, False otherwise + """ bind = op.get_bind() result = bind.execute(text( "SELECT EXISTS (SELECT 1 FROM pg_type WHERE typname = :enum_name);" @@ -33,13 +50,28 @@ def enum_type_exists(enum_name: str) -> bool: def upgrade() -> None: + """Upgrade the database schema. + + This function performs the following operations: + - Creates an enum type 'status_enum' if it doesn't exist + - Adds a 'status' column to the 'position' table if it doesn't exist + - Adds a 'contract_address' column to the 'user' table if it doesn't exist + - Drops the 'deployed_transaction_hash' column from the 'user' table if it exists + """ # Create enum type 'status_enum' if it doesn't exist if not enum_type_exists('status_enum'): op.execute("CREATE TYPE status_enum AS ENUM ('pending', 'opened', 'closed')") # Add status column to position table if it doesn't exist if not column_exists('position', 'status'): - op.add_column('position', sa.Column('status', sa.Enum('pending', 'opened', 'closed', name='status_enum'), nullable=True)) + op.add_column( + 'position', + sa.Column( + 'status', + sa.Enum('pending', 'opened', 'closed', name='status_enum'), + nullable=True + ) + ) # Add contract_address column to user table if it doesn't exist if not column_exists('user', 'contract_address'): @@ -50,6 +82,14 @@ def upgrade() -> None: op.drop_column('user', 'deployed_transaction_hash') def downgrade() -> None: + """Downgrade the database schema. + + This function performs the following operations: + - Drops the 'status' column from the 'position' table if it exists + - Drops the enum type 'status_enum' if there are no columns using it + - Drops the 'contract_address' column from the 'user' table if it exists + - Adds the 'deployed_transaction_hash' column to the 'user' table if it doesn't exist + """ # Drop status column from position table if it exists if column_exists('position', 'status'): op.drop_column('position', 'status') @@ -64,4 +104,12 @@ def downgrade() -> None: # Add deployed_transaction_hash column to user table if it doesn't exist if not column_exists('user', 'deployed_transaction_hash'): - op.add_column('user', sa.Column('deployed_transaction_hash', sa.VARCHAR(), autoincrement=False, nullable=True)) + op.add_column( + 'user', + sa.Column( + 'deployed_transaction_hash', + sa.VARCHAR(), + autoincrement=False, + nullable=True + ) + ) diff --git a/web_app/alembic/versions/d71e1e3e800f_create_user_and_position_table.py b/web_app/alembic/versions/d71e1e3e800f_create_user_and_position_table.py index 2f0ce653..2764a8ec 100644 --- a/web_app/alembic/versions/d71e1e3e800f_create_user_and_position_table.py +++ b/web_app/alembic/versions/d71e1e3e800f_create_user_and_position_table.py @@ -19,6 +19,12 @@ def upgrade() -> None: + """Upgrade the database schema. + + This function performs the following operations: + - Create 'user' table if it does not exist + - Create 'position' table if it does not exist + """ # ### commands auto generated by Alembic - please adjust! ### # Create 'user' table if it does not exist @@ -52,6 +58,12 @@ def upgrade() -> None: # ### end Alembic commands ### def downgrade() -> None: + """Downgrade the database schema. + + This function performs the following operations: + - Drop 'position' table if it exists + - Drop 'user' table if it exists + """ # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f('ix_position_user_id'), table_name='position') op.drop_table('position') diff --git a/web_app/api/dashboard.py b/web_app/api/dashboard.py index 5b173e2a..cb5234ec 100644 --- a/web_app/api/dashboard.py +++ b/web_app/api/dashboard.py @@ -1,3 +1,7 @@ +""" +This module handles dashboard-related API endpoints. +""" + import collections from fastapi import APIRouter @@ -19,7 +23,8 @@ ) async def get_dashboard(wallet_id: str) -> DashboardResponse: """ - This endpoint fetches the user's dashboard data, including balances, multipliers, start dates, and ZkLend position. + This endpoint fetches the user's dashboard data, + including balances, multipliers, start dates, and ZkLend position. ### Parameters: - **wallet_id**: User's wallet ID diff --git a/web_app/api/main.py b/web_app/api/main.py index 7fca690e..6cf84326 100644 --- a/web_app/api/main.py +++ b/web_app/api/main.py @@ -1,3 +1,11 @@ +""" +Main FastAPI application module for the SPOTNET API. + +This module sets up the FastAPI application +and includes middleware for session management and CORS. +It also includes routers for the dashboard, position, and user endpoints. +""" + import os from uuid import uuid4 @@ -11,7 +19,10 @@ app = FastAPI( title="SPOTNET API", - description="An API that supports depositing collateral, borrowing stablecoins, trading on AMMs, and managing user positions on Starknet.", + description=( + "An API that supports depositing collateral, borrowing stablecoins, " + "trading on AMMs, and managing user positions on Starknet." + ), version="0.1.0", license_info={ "name": "MIT License", diff --git a/web_app/api/position.py b/web_app/api/position.py index 3fdf9b48..035ce378 100644 --- a/web_app/api/position.py +++ b/web_app/api/position.py @@ -1,3 +1,7 @@ +""" +This module handles position-related API endpoints. +""" + from fastapi import APIRouter, Request, HTTPException from web_app.api.serializers.transaction import ( @@ -13,7 +17,13 @@ position_db_connector = PositionDBConnector() # Initialize the PositionDBConnector -@router.post("/api/create-position", tags=["Position Operations"], response_model=LoopLiquidityData, summary="Create a new position", response_description="Returns the new position and transaction data.") +@router.post( + "/api/create-position", + tags=["Position Operations"], + response_model=LoopLiquidityData, + summary="Create a new position", + response_description="Returns the new position and transaction data.", +) async def create_position_with_transaction_data( form_data: PositionFormData ) -> LoopLiquidityData: @@ -53,7 +63,13 @@ async def create_position_with_transaction_data( return LoopLiquidityData(**deposit_data) -@router.get("/api/get-repay-data", tags=["Position Operations"], response_model=RepayTransactionDataResponse, summary="Get repay data", response_description="Returns the repay transaction data.") +@router.get( + "/api/get-repay-data", + tags=["Position Operations"], + response_model=RepayTransactionDataResponse, + summary="Get repay data", + response_description="Returns the repay transaction data.", +) async def get_repay_data( supply_token: str, wallet_id: str ) -> RepayTransactionDataResponse: @@ -78,7 +94,13 @@ async def get_repay_data( return repay_data -@router.get("/api/close-position", tags=["Position Operations"], response_model=str, summary="Close a position", response_description="Returns the position status") +@router.get( + "/api/close-position", + tags=["Position Operations"], + response_model=str, + summary="Close a position", + response_description="Returns the position status", +) async def close_position(position_id: str) -> str: """ Close a position. @@ -93,7 +115,13 @@ async def close_position(position_id: str) -> str: return position_status -@router.get("/api/open-position", tags=["Position Operations"], response_model=str, summary="Open a position", response_description="Returns the positions status") +@router.get( + "/api/open-position", + tags=["Position Operations"], + response_model=str, + summary="Open a position", + response_description="Returns the positions status", +) async def open_position(position_id: str) -> str: """ Open a position. diff --git a/web_app/api/serializers/dashboard.py b/web_app/api/serializers/dashboard.py index ce719084..f4d53aee 100644 --- a/web_app/api/serializers/dashboard.py +++ b/web_app/api/serializers/dashboard.py @@ -1,3 +1,6 @@ +""" +This module defines the serializers for the dashboard data. +""" from datetime import datetime from decimal import Decimal from typing import Dict, List, Optional, Any @@ -7,16 +10,25 @@ class Data(BaseModel): + """ + Data class for position details. + """ collateral: bool debt: bool class TotalBalances(RootModel): + """ + TotalBalances class for total balances. + """ # Since the keys are dynamic (addresses), we use a generic Dict root: Dict[str, str] class Position(BaseModel): + """ + Position class for position details. + """ data: Data token_address: Optional[str] = Field(None, alias="tokenAddress") total_balances: TotalBalances = Field(alias="totalBalances") @@ -40,16 +52,25 @@ def convert_total_balances(cls, balances): return converted_balances class Config: + """ + Configuration for the Position class. + """ populate_by_name = True class Product(BaseModel): + """ + Product class for product details. + """ name: str health_ratio: str positions: List[Position] class ZkLendPositionResponse(BaseModel): + """ + ZkLendPositionResponse class for ZkLend position details. + """ products: List[Product] = Field(default_factory=list) @field_validator("products", mode="before") @@ -66,10 +87,16 @@ def convert_products(cls, products): return converted_products class Config: + """ + Configuration for the ZkLendPositionResponse class. + """ populate_by_name = True class DashboardResponse(BaseModel): + """ + DashboardResponse class for dashboard details. + """ balances: Dict[str, Any] = Field( ..., example={"ETH": 5.0, "USDC": 1000.0}, diff --git a/web_app/api/serializers/position.py b/web_app/api/serializers/position.py index 43c711ae..95f5c29b 100644 --- a/web_app/api/serializers/position.py +++ b/web_app/api/serializers/position.py @@ -1,3 +1,7 @@ +""" +This module defines the serializers for the position data. +""" + from pydantic import BaseModel, field_validator diff --git a/web_app/api/serializers/transaction.py b/web_app/api/serializers/transaction.py index dc3513d1..172fbcbf 100644 --- a/web_app/api/serializers/transaction.py +++ b/web_app/api/serializers/transaction.py @@ -1,3 +1,7 @@ +""" +This module defines the serializers for the transaction data. +""" + from pydantic import BaseModel, field_validator @@ -25,6 +29,10 @@ def convert_int_to_str(cls, value) -> str: class DepositData(BaseModel): + """ + Pydantic model for the deposit data. + """ + token: str amount: str multiplier: str @@ -85,8 +93,16 @@ class UpdateUserContractRequest(BaseModel): class DeploymentStatus(BaseModel): + """ + Pydantic model for the deployment status. + """ + is_contract_deployed: bool class ContractAddress(BaseModel): + """ + Pydantic model for the contract address. + """ + contract_address: str | None diff --git a/web_app/api/serializers/user.py b/web_app/api/serializers/user.py index 932dd3fb..46c5e652 100644 --- a/web_app/api/serializers/user.py +++ b/web_app/api/serializers/user.py @@ -1,19 +1,32 @@ +""" +This module defines the serializers for the user data. +""" + from pydantic import BaseModel, Field class CheckUserResponse(BaseModel): + """ + Pydantic model for the check user response. + """ is_contract_deployed: bool = Field( ..., example=False, description="Indicates if the user's contract is deployed." ) class UpdateUserContractResponse(BaseModel): + """ + Pydantic model for the update user contract response. + """ is_contract_deployed: bool = Field( ..., example=False, description="Indicates if the user's contract is deployed." ) class GetUserContractAddressResponse(BaseModel): + """ + Pydantic model for the get user contract address response. + """ contract_address: str | None = Field( None, example="0xabc123...", diff --git a/web_app/api/user.py b/web_app/api/user.py index 3a1dbd43..535daf84 100644 --- a/web_app/api/user.py +++ b/web_app/api/user.py @@ -1,14 +1,30 @@ +""" +This module handles user-related API endpoints. +""" + from fastapi import APIRouter, Request, HTTPException from web_app.db.crud import UserDBConnector from web_app.api.serializers.transaction import UpdateUserContractRequest -from web_app.api.serializers.user import CheckUserResponse, UpdateUserContractResponse, GetUserContractAddressResponse +from web_app.api.serializers.user import ( + CheckUserResponse, + UpdateUserContractResponse, + GetUserContractAddressResponse +) router = APIRouter() # Initialize the router user_db = UserDBConnector() -@router.get("/api/get-user-contract", tags=["User Operations"], summary="Get user's contract status", response_description="Returns 0 if the user is None or if the contract is not deployed. Returns the transaction hash if the contract is deployed.") +@router.get( + "/api/get-user-contract", + tags=["User Operations"], + summary="Get user's contract status", + response_description=( + "Returns 0 if the user is None or if the contract is not deployed. " + "Returns the transaction hash if the contract is deployed." + ), +) async def get_user_contract(wallet_id: str) -> str: """ Get the contract status of a user. @@ -25,7 +41,13 @@ async def get_user_contract(wallet_id: str) -> str: return user.contract_address -@router.get("/api/check-user", tags=["User Operations"], summary="Check if user exists and contract status", response_model=CheckUserResponse, response_description="Returns whether the user's contract is deployed.") +@router.get( + "/api/check-user", + tags=["User Operations"], + summary="Check if user exists and contract status", + response_model=CheckUserResponse, + response_description="Returns whether the user's contract is deployed.", +) async def check_user(wallet_id: str) -> CheckUserResponse: """ This endpoint checks if the user exists, or adds the user to the database if they don't exist, @@ -48,7 +70,13 @@ async def check_user(wallet_id: str) -> CheckUserResponse: return {"is_contract_deployed": True} -@router.post("/api/update-user-contract", tags=["User Operations"], summary="Update the user's contract", response_model=UpdateUserContractResponse, response_description="Returns if the contract is updated and deployed.") +@router.post( + "/api/update-user-contract", + tags=["User Operations"], + summary="Update the user's contract", + response_model=UpdateUserContractResponse, + response_description="Returns if the contract is updated and deployed.", +) async def update_user_contract(data: UpdateUserContractRequest) -> UpdateUserContractResponse: """ This endpoint updates the user's contract. @@ -69,7 +97,13 @@ async def update_user_contract(data: UpdateUserContractRequest) -> UpdateUserCo return {"is_contract_deployed": False} -@router.get("/api/get-user-contract-address", tags=["User Operations"], summary="Get user's contract address", response_model=GetUserContractAddressResponse, response_description="Returns the contract address of the user or None if not deployed.") +@router.get( + "/api/get-user-contract-address", + tags=["User Operations"], + summary="Get user's contract address", + response_model=GetUserContractAddressResponse, + response_description="Returns the contract address of the user or None if not deployed.", +) async def get_user_contract_address(wallet_id: str) -> GetUserContractAddressResponse: """ This endpoint retrieves the contract address of a user. diff --git a/web_app/contract_tools/api_request.py b/web_app/contract_tools/api_request.py index 03235087..3b5d32b8 100644 --- a/web_app/contract_tools/api_request.py +++ b/web_app/contract_tools/api_request.py @@ -1,3 +1,7 @@ +""" +This module handles API requests. +""" + import aiohttp @@ -72,6 +76,9 @@ async def fetch_text( # Example usage: async def main(): + """ + Main function to demonstrate APIRequest usage. + """ # Initialize the APIRequest with a base URL api = APIRequest(base_url="https://portfolio.argent.xyz") diff --git a/web_app/contract_tools/blockchain_call.py b/web_app/contract_tools/blockchain_call.py index 46091bcf..8dae4f01 100644 --- a/web_app/contract_tools/blockchain_call.py +++ b/web_app/contract_tools/blockchain_call.py @@ -1,3 +1,7 @@ +""" +This module handles the blockchain calls. +""" + import logging import os import time @@ -104,8 +108,12 @@ async def _get_pool_price(self, pool_key, is_token1: bool): ) price_data = await ekubo_contract.functions["get_pool_price"].call(pool_key) - underlying_token_0_address = TokenParams.add_underlying_address(str(hex(pool_key["token0"]))) - underlying_token_1_address = TokenParams.add_underlying_address(str(hex(pool_key["token1"]))) + underlying_token_0_address = TokenParams.add_underlying_address( + str(hex(pool_key["token0"])) + ) + underlying_token_1_address = TokenParams.add_underlying_address( + str(hex(pool_key["token1"])) + ) token_0_decimals = TokenParams.get_token_decimals(underlying_token_0_address) token_1_decimals = TokenParams.get_token_decimals(underlying_token_1_address) diff --git a/web_app/contract_tools/constants.py b/web_app/contract_tools/constants.py index 66921b52..921666c4 100644 --- a/web_app/contract_tools/constants.py +++ b/web_app/contract_tools/constants.py @@ -1,3 +1,7 @@ +""" +This module contains constants for the contract tools. +""" + import os from dataclasses import dataclass from enum import Enum @@ -107,7 +111,9 @@ def add_underlying_address(token_address: str) -> str: class ProtocolAddress(Enum): - + """ + Enum for the protocol addresses. + """ zklend: str = "0x04c0a5193d58f74fbace4b74dcf65481e734ed1714121bdc571da345540efa05" nostra: str = "0x00c530f2c0aa4c16a0806365b0898499fba372e5df7a7172dc6fe9ba777e8007" diff --git a/web_app/contract_tools/mixins/dashboard.py b/web_app/contract_tools/mixins/dashboard.py index f9241390..3582a538 100644 --- a/web_app/contract_tools/mixins/dashboard.py +++ b/web_app/contract_tools/mixins/dashboard.py @@ -1,3 +1,7 @@ +""" +This module contains the dashboard mixin class. +""" + from typing import Dict from web_app.contract_tools.blockchain_call import StarknetClient @@ -6,7 +10,8 @@ from web_app.api.serializers.dashboard import ZkLendPositionResponse CLIENT = StarknetClient() -# ARGENT_X_POSITION_URL = "https://cloud.argent-api.com/v1/tokens/defi/decomposition/{wallet_id}?chain=starknet" +# alternative ARGENT_X_POSITION_URL +# "https://cloud.argent-api.com/v1/tokens/defi/decomposition/{wallet_id}?chain=starknet" ARGENT_X_POSITION_URL = "https://cloud.argent-api.com/v1/tokens/defi/" diff --git a/web_app/contract_tools/mixins/deposit.py b/web_app/contract_tools/mixins/deposit.py index 621cf61d..8ac33a9e 100644 --- a/web_app/contract_tools/mixins/deposit.py +++ b/web_app/contract_tools/mixins/deposit.py @@ -1,9 +1,14 @@ +""" +This module contains the deposit mixin class. +""" + from decimal import Decimal from web_app.contract_tools.blockchain_call import StarknetClient from web_app.contract_tools.constants import SPOTNET_CORE_ADDRESS, TokenParams CLIENT = StarknetClient() -# ARGENT_X_POSITION_URL = "https://cloud.argent-api.com/v1/tokens/defi/decomposition/{wallet_id}?chain=starknet" +# alternative ARGENT_X_POSITION_URL +# "https://cloud.argent-api.com/v1/tokens/defi/decomposition/{wallet_id}?chain=starknet" ARGENT_X_POSITION_URL = "https://cloud.argent-api.com/v1/tokens/defi/" diff --git a/web_app/contract_tools/utils.py b/web_app/contract_tools/utils.py index daa39bfb..403646a4 100644 --- a/web_app/contract_tools/utils.py +++ b/web_app/contract_tools/utils.py @@ -1,3 +1,7 @@ +""" +This module contains utility functions for the contract tools. +""" + from typing import Dict from decimal import Decimal @@ -7,7 +11,8 @@ from web_app.api.serializers.dashboard import ZkLendPositionResponse CLIENT = StarknetClient() -# ARGENT_X_POSITION_URL = "https://cloud.argent-api.com/v1/tokens/defi/decomposition/{wallet_id}?chain=starknet" +# alternative ARGENT_X_POSITION_URL +# "https://cloud.argent-api.com/v1/tokens/defi/decomposition/{wallet_id}?chain=starknet" ARGENT_X_POSITION_URL = "https://cloud.argent-api.com/v1/tokens/defi/" diff --git a/web_app/db/crud.py b/web_app/db/crud.py index 367e97a8..a20ade37 100644 --- a/web_app/db/crud.py +++ b/web_app/db/crud.py @@ -1,3 +1,7 @@ +""" +This module contains the CRUD operations for the database. +""" + import logging import uuid from typing import Type, TypeVar @@ -193,7 +197,8 @@ def _get_user_by_wallet_id(self, wallet_id: str) -> User | None: def get_positions_by_wallet_id(self, wallet_id: str) -> list: """ - Retrieves all positions for a user by their wallet ID and returns them as a list of dictionaries. + Retrieves all positions for a user by their wallet ID + and returns them as a list of dictionaries. :param wallet_id: str :return: list of dict """ diff --git a/web_app/db/database.py b/web_app/db/database.py index 42a4be3f..845e6b87 100644 --- a/web_app/db/database.py +++ b/web_app/db/database.py @@ -1,3 +1,7 @@ +""" +This module contains the database configuration and session. +""" + import os from dotenv import load_dotenv diff --git a/web_app/db/models.py b/web_app/db/models.py index c5ca96e0..ab7f815d 100644 --- a/web_app/db/models.py +++ b/web_app/db/models.py @@ -1,3 +1,7 @@ +""" +This module contains the SQLAlchemy models for the database. +""" + from uuid import uuid4 from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.sql import func @@ -7,12 +11,19 @@ class Status(PyEnum): + """ + Enum for the position status. + """ + PENDING = "pending" OPENED = "opened" CLOSED = "closed" @classmethod def choices(cls): + """ + Returns the list of status choices. + """ return [status.value for status in cls] diff --git a/web_app/tests/conftest.py b/web_app/tests/conftest.py index d9b53b29..dd2da7f0 100644 --- a/web_app/tests/conftest.py +++ b/web_app/tests/conftest.py @@ -1,3 +1,7 @@ +""" +This module contains the fixtures for the tests. +""" + from unittest.mock import MagicMock import pytest diff --git a/web_app/tests/test_user.py b/web_app/tests/test_user.py index 316e6402..3ef2a4d0 100644 --- a/web_app/tests/test_user.py +++ b/web_app/tests/test_user.py @@ -1,3 +1,7 @@ +""" +This module contains the tests for the user endpoints. +""" + from unittest.mock import MagicMock import pytest From 29f9b3c43f0913adbeec5e366c9f2dab5719a040 Mon Sep 17 00:00:00 2001 From: Ikem Peter Date: Thu, 24 Oct 2024 18:54:12 +0100 Subject: [PATCH 2/2] tweek workflow --- .github/workflows/pylint.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 89e6f6c2..484d0951 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,6 +1,10 @@ name: Pylint -on: [push] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: build: