From 51ef90a110f796513fc8ad4a2e1b220bd7cde6f9 Mon Sep 17 00:00:00 2001 From: Conor <142396794+conorzen@users.noreply.github.com> Date: Sat, 23 Aug 2025 13:13:00 +0100 Subject: [PATCH 1/4] added git workflow --- .github/workflows/black_formatting.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/black_formatting.yml diff --git a/.github/workflows/black_formatting.yml b/.github/workflows/black_formatting.yml new file mode 100644 index 0000000..9fbf399 --- /dev/null +++ b/.github/workflows/black_formatting.yml @@ -0,0 +1,37 @@ +name: Code Formatting Check + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +jobs: + black-formatting: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + + - name: Install UV + uses: astral-sh/setup-uv@v4 + + - name: Install dependencies + run: uv sync --dev + + - name: Check Black formatting + run: | + uv run black --check --diff . + + - name: Comment on formatting issues + if: failure() + run: | + echo "❌ Code is not properly formatted with Black" + echo "Run 'uv run black .' to fix formatting issues" + exit 1 \ No newline at end of file From c24b8292d1c0b5a0df124f3061a76d81e856ddba Mon Sep 17 00:00:00 2001 From: Conor <142396794+conorzen@users.noreply.github.com> Date: Sat, 23 Aug 2025 13:16:02 +0100 Subject: [PATCH 2/4] updated toml --- pyproject.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4a78756..f01dff1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,3 +11,21 @@ dependencies = [ "scipy==1.16.1", "seaborn==0.13.2", ] +[tool.black] +line-length = 88 +target-version = ['py313'] +include = '\.pyi?$' +exclude = ''' +/( + \.eggs + | \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist +)/ +''' \ No newline at end of file From 417ace03503cd16ee27ca6c0a769f7117f452a46 Mon Sep 17 00:00:00 2001 From: Conor <142396794+conorzen@users.noreply.github.com> Date: Sat, 23 Aug 2025 13:21:51 +0100 Subject: [PATCH 3/4] formatted --- portfolio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portfolio.py b/portfolio.py index 6bf2950..bfb4cb9 100644 --- a/portfolio.py +++ b/portfolio.py @@ -11,7 +11,7 @@ class Portfolio: def __init__(self): - self.symbols = ["IBM","QBTS"] + self.symbols = ["IBM", "QBTS"] self.time_frame = 60 def get_stock(self, symbols, time_frame): @@ -58,7 +58,7 @@ def data_clean(self): clean_data = self.data_extract(data) all_dfs.append(clean_data) df = pl.DataFrame([all_dfs]) - + print(df) return df From 7f557540f6ceee46f61ef558fa74d6fbb61908e0 Mon Sep 17 00:00:00 2001 From: Conor <142396794+conorzen@users.noreply.github.com> Date: Sat, 23 Aug 2025 13:25:27 +0100 Subject: [PATCH 4/4] formatted updated yaml --- .github/workflows/black_formatting.yml | 27 ++++++-------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/black_formatting.yml b/.github/workflows/black_formatting.yml index 9fbf399..fac9795 100644 --- a/.github/workflows/black_formatting.yml +++ b/.github/workflows/black_formatting.yml @@ -2,7 +2,7 @@ name: Code Formatting Check on: push: - branches: [ main, develop ] + branches: [ main, develop, fix-read-me ] pull_request: branches: [ main, develop ] @@ -14,24 +14,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Check code formatting with Black + uses: psf/black@stable with: - python-version: '3.13' - - - name: Install UV - uses: astral-sh/setup-uv@v4 - - - name: Install dependencies - run: uv sync --dev - - - name: Check Black formatting - run: | - uv run black --check --diff . - - - name: Comment on formatting issues - if: failure() - run: | - echo "❌ Code is not properly formatted with Black" - echo "Run 'uv run black .' to fix formatting issues" - exit 1 \ No newline at end of file + options: "--check --diff" + src: "." + version: "~= 24.0" \ No newline at end of file