From 93c7a38187115436dc752827d87ca03c3ff1272b Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:13:04 -0500 Subject: [PATCH 01/36] Add Radon analysis workflow for cyclomatic complexity checks --- .github/workflows/radon-analysis.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/radon-analysis.yml diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml new file mode 100644 index 00000000..6caa9273 --- /dev/null +++ b/.github/workflows/radon-analysis.yml @@ -0,0 +1,39 @@ +name: Radon Cyclomatic Complexity + +on: + push: + branches: + - main + pull_request: + +jobs: + radon-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install radon + + - name: Run Radon Cyclomatic Complexity + run: radon cc -s -a src/ + + - name: Comment on Pull Request + if: github.event_name == 'pull_request' + uses: marocchino/sticky-pull-request-comment@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + header: Radon Cyclomatic Complexity Report + message: | + ```console + $(radon cc -s -a src/) + ``` \ No newline at end of file From 54f561ca96b61740d87c5bfcc36b677fc76947cb Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:16:02 -0500 Subject: [PATCH 02/36] Enhance Radon analysis workflow to capture and output cyclomatic complexity results --- .github/workflows/radon-analysis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 6caa9273..3ad4087b 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -25,7 +25,11 @@ jobs: pip install radon - name: Run Radon Cyclomatic Complexity - run: radon cc -s -a src/ + id: radon + run: | + radon_output=$(radon cc -s -a src/) + echo "$radon_output" + echo "::set-output name=radon_output::$radon_output" - name: Comment on Pull Request if: github.event_name == 'pull_request' @@ -35,5 +39,5 @@ jobs: header: Radon Cyclomatic Complexity Report message: | ```console - $(radon cc -s -a src/) + ${{ steps.radon.outputs.radon_output }} ``` \ No newline at end of file From 72e3347094f8032e24044cdd3e1d42a977528052 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:17:54 -0500 Subject: [PATCH 03/36] Update Radon analysis workflow to save cyclomatic complexity output to a file and read from it --- .github/workflows/radon-analysis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 3ad4087b..a578455a 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -25,11 +25,14 @@ jobs: pip install radon - name: Run Radon Cyclomatic Complexity + run: | + radon cc -s -a src/ > radon_output.txt + + - name: Read Radon Output id: radon run: | - radon_output=$(radon cc -s -a src/) - echo "$radon_output" - echo "::set-output name=radon_output::$radon_output" + output=$(cat radon_output.txt) + echo "::set-output name=radon_output::$output" - name: Comment on Pull Request if: github.event_name == 'pull_request' From 29551f8b354c54eaacfa88f79ccd3d9b084a706b Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:20:55 -0500 Subject: [PATCH 04/36] test --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index a578455a..e67c7aa1 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -26,7 +26,7 @@ jobs: - name: Run Radon Cyclomatic Complexity run: | - radon cc -s -a src/ > radon_output.txt + radon cc -s -a src/masoniteorm/collection > radon_output.txt - name: Read Radon Output id: radon From efc95677712805f83a70d1834fcd81ea1b0e06d2 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:22:51 -0500 Subject: [PATCH 05/36] Update Radon analysis workflow to set output using GitHub environment variable --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index e67c7aa1..2e351265 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -32,7 +32,7 @@ jobs: id: radon run: | output=$(cat radon_output.txt) - echo "::set-output name=radon_output::$output" + echo "radon_output=$output" >> $GITHUB_ENV - name: Comment on Pull Request if: github.event_name == 'pull_request' From 162fced99093ddea1dd3a1d32a713cef888b7f3c Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:23:52 -0500 Subject: [PATCH 06/36] Update Radon analysis workflow to use set-output for environment variable --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 2e351265..e67c7aa1 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -32,7 +32,7 @@ jobs: id: radon run: | output=$(cat radon_output.txt) - echo "radon_output=$output" >> $GITHUB_ENV + echo "::set-output name=radon_output::$output" - name: Comment on Pull Request if: github.event_name == 'pull_request' From e364693bd8952c5c1a588f9f51e402dabdf5f13e Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:26:51 -0500 Subject: [PATCH 07/36] Refactor Radon analysis workflow to streamline output handling and remove redundant step --- .github/workflows/radon-analysis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index e67c7aa1..7d6ec474 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -25,13 +25,11 @@ jobs: pip install radon - name: Run Radon Cyclomatic Complexity - run: | - radon cc -s -a src/masoniteorm/collection > radon_output.txt - - - name: Read Radon Output id: radon run: | + radon cc -s -a src/masoniteorm/collection > radon_output.txt output=$(cat radon_output.txt) + echo "$output" echo "::set-output name=radon_output::$output" - name: Comment on Pull Request @@ -43,4 +41,4 @@ jobs: message: | ```console ${{ steps.radon.outputs.radon_output }} - ``` \ No newline at end of file + ``` From fe5a784b574bd86feb253698c37a576c7d026104 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:29:19 -0500 Subject: [PATCH 08/36] Update Radon analysis workflow to set output using GitHub environment variable --- .github/workflows/radon-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 7d6ec474..a347026f 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -30,7 +30,7 @@ jobs: radon cc -s -a src/masoniteorm/collection > radon_output.txt output=$(cat radon_output.txt) echo "$output" - echo "::set-output name=radon_output::$output" + echo "radon_output=$output" >> $GITHUB_ENV - name: Comment on Pull Request if: github.event_name == 'pull_request' @@ -40,5 +40,5 @@ jobs: header: Radon Cyclomatic Complexity Report message: | ```console - ${{ steps.radon.outputs.radon_output }} + ${{ env.radon_output }} ``` From 0d34132e0cf0e1992a15996979ecaa9787216bb8 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:33:15 -0500 Subject: [PATCH 09/36] Update Radon analysis workflow to enhance reporting and streamline comments on pull requests --- .github/workflows/radon-analysis.yml | 55 +++++++++------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index a347026f..cef437b1 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -1,44 +1,23 @@ -name: Radon Cyclomatic Complexity - +name: Radon Analysis on: - push: - branches: - - main pull_request: + branches: ["2.0"] jobs: - radon-check: + comment: + permissions: + pull-requests: write runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.x - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install radon - - - name: Run Radon Cyclomatic Complexity - id: radon - run: | - radon cc -s -a src/masoniteorm/collection > radon_output.txt - output=$(cat radon_output.txt) - echo "$output" - echo "radon_output=$output" >> $GITHUB_ENV - - - name: Comment on Pull Request - if: github.event_name == 'pull_request' - uses: marocchino/sticky-pull-request-comment@v2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - header: Radon Cyclomatic Complexity Report - message: | - ```console - ${{ env.radon_output }} - ``` + - uses: actions/checkout@v3 + - name: Create Radon's reports + run: | + radon cc src/ -j >cc.json + radon mi src/ -j >mi.json + radon hal src/ -j >hal.json + - name: Comment the results on the PR + uses: Libra-foundation/radon-comment@V1.0 + with: + cc: "cc.json" + mi: "mi.json" + hal: "hal.json" \ No newline at end of file From 84b168ea0bd6be3b7d2338af607b82238364ecb1 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:34:13 -0500 Subject: [PATCH 10/36] Update Radon comment action to use version 0.1 --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index cef437b1..e1ec1c4a 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -16,7 +16,7 @@ jobs: radon mi src/ -j >mi.json radon hal src/ -j >hal.json - name: Comment the results on the PR - uses: Libra-foundation/radon-comment@V1.0 + uses: Libra-foundation/radon-comment@V0.1 with: cc: "cc.json" mi: "mi.json" From a0534d8308d8e2fec4d0bb8d1f1f11d0f323d4f6 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:36:18 -0500 Subject: [PATCH 11/36] Fix version tag for Radon comment action in workflow --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index e1ec1c4a..c83c687e 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -16,7 +16,7 @@ jobs: radon mi src/ -j >mi.json radon hal src/ -j >hal.json - name: Comment the results on the PR - uses: Libra-foundation/radon-comment@V0.1 + uses: Libra-foundation/radon-comment@v0.1 with: cc: "cc.json" mi: "mi.json" From c50c9dc2322dfd36d9c0b7674d92f1fe143f6de0 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:37:38 -0500 Subject: [PATCH 12/36] Add installation step for Radon in analysis workflow --- .github/workflows/radon-analysis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index c83c687e..5e9cc433 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Install Radon + run: pip install radon - name: Create Radon's reports run: | radon cc src/ -j >cc.json From 49a2427222ae88877a8201795d6a3a4855c06a70 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:41:10 -0500 Subject: [PATCH 13/36] Update Radon analysis workflow to report on changed files only --- .github/workflows/radon-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 5e9cc433..908b06b1 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -14,9 +14,9 @@ jobs: run: pip install radon - name: Create Radon's reports run: | - radon cc src/ -j >cc.json - radon mi src/ -j >mi.json - radon hal src/ -j >hal.json + radon cc $(git diff --name-only origin/2.0) -j >cc.json + radon mi $(git diff --name-only origin/2.0) -j >mi.json + radon hal $(git diff --name-only origin/2.0) -j >hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: From 12a213252f63dfb3dd4e441068d2599c4b5f922f Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:42:12 -0500 Subject: [PATCH 14/36] Update Radon analysis workflow to use the latest commit for reporting --- .github/workflows/radon-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 908b06b1..e8adf3e5 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -14,9 +14,9 @@ jobs: run: pip install radon - name: Create Radon's reports run: | - radon cc $(git diff --name-only origin/2.0) -j >cc.json - radon mi $(git diff --name-only origin/2.0) -j >mi.json - radon hal $(git diff --name-only origin/2.0) -j >hal.json + radon cc $(git diff --name-only origin/HEAD) -j >cc.json + radon mi $(git diff --name-only origin/HEAD) -j >mi.json + radon hal $(git diff --name-only origin/HEAD) -j >hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: From c3e3ce734b0f78ac86d2ac1cda8faa026d919c03 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:46:10 -0500 Subject: [PATCH 15/36] Update Radon analysis workflow to use the correct base branch for reporting --- .github/workflows/radon-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index e8adf3e5..908b06b1 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -14,9 +14,9 @@ jobs: run: pip install radon - name: Create Radon's reports run: | - radon cc $(git diff --name-only origin/HEAD) -j >cc.json - radon mi $(git diff --name-only origin/HEAD) -j >mi.json - radon hal $(git diff --name-only origin/HEAD) -j >hal.json + radon cc $(git diff --name-only origin/2.0) -j >cc.json + radon mi $(git diff --name-only origin/2.0) -j >mi.json + radon hal $(git diff --name-only origin/2.0) -j >hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: From 6e716cdf79cd968880bc3e949a8f56599bbfa4f6 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:47:09 -0500 Subject: [PATCH 16/36] Add test comment in __setitem__ method of Collection class --- src/masoniteorm/collection/Collection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/masoniteorm/collection/Collection.py b/src/masoniteorm/collection/Collection.py index e238db8a..a24e98af 100644 --- a/src/masoniteorm/collection/Collection.py +++ b/src/masoniteorm/collection/Collection.py @@ -542,6 +542,7 @@ def __getitem__(self, item): return None def __setitem__(self, key, value): + # test self._items[key] = value def __delitem__(self, key): From d4bd4253a03649ade14c44731739df15a1d84b02 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:48:18 -0500 Subject: [PATCH 17/36] Fix Radon analysis workflow to use the correct branch reference for reporting --- .github/workflows/radon-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 908b06b1..d2c23126 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -14,9 +14,9 @@ jobs: run: pip install radon - name: Create Radon's reports run: | - radon cc $(git diff --name-only origin/2.0) -j >cc.json - radon mi $(git diff --name-only origin/2.0) -j >mi.json - radon hal $(git diff --name-only origin/2.0) -j >hal.json + radon cc $(git diff --name-only 2.0) -j >cc.json + radon mi $(git diff --name-only 2.0) -j >mi.json + radon hal $(git diff --name-only 2.0) -j >hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: From a01f769c68953ec09c14ce53547065324e636df2 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:51:20 -0500 Subject: [PATCH 18/36] Update Radon analysis workflow to use the correct range for changed files --- .github/workflows/radon-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index d2c23126..91278b34 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -14,9 +14,9 @@ jobs: run: pip install radon - name: Create Radon's reports run: | - radon cc $(git diff --name-only 2.0) -j >cc.json - radon mi $(git diff --name-only 2.0) -j >mi.json - radon hal $(git diff --name-only 2.0) -j >hal.json + radon cc $(git diff --name-only 2.0...HEAD) -j >cc.json + radon mi $(git diff --name-only 2.0...HEAD) -j >mi.json + radon hal $(git diff --name-only 2.0...HEAD) -j >hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: From 86daadff859d0edef973436697e0fbc963adde02 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:52:51 -0500 Subject: [PATCH 19/36] Handle empty file lists in Radon analysis workflow to prevent errors --- .github/workflows/radon-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 91278b34..ad1b8113 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -14,9 +14,9 @@ jobs: run: pip install radon - name: Create Radon's reports run: | - radon cc $(git diff --name-only 2.0...HEAD) -j >cc.json - radon mi $(git diff --name-only 2.0...HEAD) -j >mi.json - radon hal $(git diff --name-only 2.0...HEAD) -j >hal.json + radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json + radon mi $(git diff --name-only 2.0...HEAD || echo "no_files") -j >mi.json + radon hal $(git diff --name-only 2.0...HEAD || echo "no_files") -j >hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: From f62592e1208eab408de0dbfb6d8ee8e899413f99 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:56:18 -0500 Subject: [PATCH 20/36] Refactor Radon analysis workflow to support both push and pull_request events and ensure full git history is available --- .github/workflows/radon-analysis.yml | 41 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index ad1b8113..1e9ee5e4 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -1,25 +1,26 @@ name: Radon Analysis -on: - pull_request: - branches: ["2.0"] + +on: [push, pull_request] jobs: - comment: - permissions: - pull-requests: write + radon-analysis: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Install Radon - run: pip install radon - - name: Create Radon's reports - run: | - radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json - radon mi $(git diff --name-only 2.0...HEAD || echo "no_files") -j >mi.json - radon hal $(git diff --name-only 2.0...HEAD || echo "no_files") -j >hal.json - - name: Comment the results on the PR - uses: Libra-foundation/radon-comment@v0.1 - with: - cc: "cc.json" - mi: "mi.json" - hal: "hal.json" \ No newline at end of file + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history for all branches and tags + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Radon + run: pip install radon + + - name: Run Radon Analysis + run: | + git fetch --unshallow # Ensure full history is available + radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json \ No newline at end of file From 07b3a0b8e5a9bf9667457d3308436f7cf6dd124c Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 18:57:34 -0500 Subject: [PATCH 21/36] Simplify git fetch command in Radon analysis workflow to ensure full history is available --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 1e9ee5e4..f15278ae 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -22,5 +22,5 @@ jobs: - name: Run Radon Analysis run: | - git fetch --unshallow # Ensure full history is available + git fetch # Ensure full history is available radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json \ No newline at end of file From 1f823786a041d0e78194dcc674b0e8778db972fa Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:00:06 -0500 Subject: [PATCH 22/36] Update Radon analysis workflow to use the correct base branch for changed files --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index f15278ae..4a827681 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -23,4 +23,4 @@ jobs: - name: Run Radon Analysis run: | git fetch # Ensure full history is available - radon cc $(git diff --name-only 2.0...HEAD || echo "no_files") -j >cc.json \ No newline at end of file + radon cc $(git diff --name-only master...HEAD || echo "no_files") -j >cc.json \ No newline at end of file From af80dd2ef8646880c132435938317ce788a3984c Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:03:58 -0500 Subject: [PATCH 23/36] Refactor Radon analysis workflow to trigger on pull requests and streamline report generation --- .github/workflows/radon-analysis.yml | 41 +++++++++++++--------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 4a827681..55ee2dda 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -1,26 +1,23 @@ -name: Radon Analysis - -on: [push, pull_request] +name: Radon +on: + pull_request: + branches: ["main"] jobs: - radon-analysis: + comment: + permissions: + pull-requests: write runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch all history for all branches and tags - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: Install Radon - run: pip install radon - - - name: Run Radon Analysis - run: | - git fetch # Ensure full history is available - radon cc $(git diff --name-only master...HEAD || echo "no_files") -j >cc.json \ No newline at end of file + - uses: actions/checkout@v3 + - name: Create Radon's reports + run: | + radon cc src/ -j >cc.json + radon mi src/ -j >mi.json + radon hal src/ -j >hal.json + - name: Comment the results on the PR + uses: Libra-foundation/radon-comment@v0.1 + with: + cc: "cc.json" + mi: "mi.json" + hal: "hal.json" \ No newline at end of file From b28e152019e31e86a1cb576688f4bf26ac24bffd Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:05:01 -0500 Subject: [PATCH 24/36] Update Radon analysis workflow to trigger on pull requests for the 2.0 branch --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 55ee2dda..6d5b31b6 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -1,7 +1,7 @@ name: Radon on: pull_request: - branches: ["main"] + branches: ["2.0"] jobs: comment: From 583a32fafd6e6a1c6f01a30d05db5a3e234f52c8 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:05:57 -0500 Subject: [PATCH 25/36] Add Radon installation step to analysis workflow --- .github/workflows/radon-analysis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 6d5b31b6..17787d8d 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Install Radon + run: pip install radon - name: Create Radon's reports run: | radon cc src/ -j >cc.json From 97a853eec7df07800d0cb69fa34a13d48a48e5ba Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:09:03 -0500 Subject: [PATCH 26/36] Add printing of Radon reports in analysis workflow --- .github/workflows/radon-analysis.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 17787d8d..d608ff40 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -17,9 +17,18 @@ jobs: radon cc src/ -j >cc.json radon mi src/ -j >mi.json radon hal src/ -j >hal.json + - name: Print Radon reports + run: | + echo "Cyclomatic Complexity Report:" + cat cc.json + echo "Maintainability Index Report:" + cat mi.json + echo "Halstead Metrics Report:" + cat hal.json - name: Comment the results on the PR uses: Libra-foundation/radon-comment@v0.1 with: cc: "cc.json" mi: "mi.json" - hal: "hal.json" \ No newline at end of file + hal: "hal.json" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 1742970f4735834fd4d858a56c664d81d0c33688 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:16:30 -0500 Subject: [PATCH 27/36] Enhance Radon analysis workflow to trigger on Python file changes and streamline report generation --- .github/workflows/radon-analysis.yml | 75 +++++++++++++++++----------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index d608ff40..e09b63fa 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -1,34 +1,53 @@ -name: Radon +name: Radon Analysis + on: pull_request: - branches: ["2.0"] + paths: + - '**/*.py' # Only trigger for Python files jobs: - comment: - permissions: - pull-requests: write + radon_analysis: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Install Radon - run: pip install radon - - name: Create Radon's reports - run: | - radon cc src/ -j >cc.json - radon mi src/ -j >mi.json - radon hal src/ -j >hal.json - - name: Print Radon reports - run: | - echo "Cyclomatic Complexity Report:" - cat cc.json - echo "Maintainability Index Report:" - cat mi.json - echo "Halstead Metrics Report:" - cat hal.json - - name: Comment the results on the PR - uses: Libra-foundation/radon-comment@v0.1 - with: - cc: "cc.json" - mi: "mi.json" - hal: "hal.json" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install Radon + run: pip install radon + + - name: Get list of changed files + id: get_changed_files + run: | + echo "CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py$')" >> $GITHUB_ENV + + - name: Run Radon analysis + id: radon_analysis + run: | + if [ -z "${{ env.CHANGED_FILES }}" ]; then + echo "No Python files changed." + echo "RESULTS=None" >> $GITHUB_ENV + else + RESULTS=$(echo "${{ env.CHANGED_FILES }}" | xargs radon cc -s -n A) + echo "RESULTS=$RESULTS" >> $GITHUB_ENV + fi + + - name: Comment on PR + if: env.RESULTS != 'None' + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Radon Complexity Analysis + message: | + **Radon Analysis Results:** + ``` + ${{ env.RESULTS }} + ``` + + - name: Comment no Python files found + if: env.RESULTS == 'None' + run: echo "No Python files changed in this PR." From dc4a53d577307110b4a0aefb847970862e304493 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:21:06 -0500 Subject: [PATCH 28/36] Enhance Radon analysis workflow to fetch full git history and debug changed Python files --- .github/workflows/radon-analysis.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index e09b63fa..5652908f 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -12,7 +12,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + with: + fetch-depth: 0 # Ensure full history is fetched for git diff to work + - name: Set up Python uses: actions/setup-python@v4 with: @@ -24,7 +26,15 @@ jobs: - name: Get list of changed files id: get_changed_files run: | - echo "CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py$')" >> $GITHUB_ENV + git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py$' || true) + echo "Changed files: $CHANGED_FILES" + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + + - name: Debug changed files + run: | + echo "Changed files from env: ${{ env.CHANGED_FILES }}" + shell: bash - name: Run Radon analysis id: radon_analysis @@ -48,6 +58,6 @@ jobs: ${{ env.RESULTS }} ``` - - name: Comment no Python files found + - name: Log if no Python files found if: env.RESULTS == 'None' run: echo "No Python files changed in this PR." From 3a97cb341276969a822c383d7081f1d08ca6da24 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:23:08 -0500 Subject: [PATCH 29/36] Refine Radon analysis workflow to improve environment variable handling and ensure proper output formatting --- .github/workflows/radon-analysis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 5652908f..609bb2bd 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Ensure full history is fetched for git diff to work + fetch-depth: 0 # Ensure full history is fetched for git diff to work properly - name: Set up Python uses: actions/setup-python@v4 @@ -26,10 +26,11 @@ jobs: - name: Get list of changed files id: get_changed_files run: | - git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py$' || true) echo "Changed files: $CHANGED_FILES" - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + echo "CHANGED_FILES<> $GITHUB_ENV + echo "$CHANGED_FILES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - name: Debug changed files run: | @@ -43,8 +44,10 @@ jobs: echo "No Python files changed." echo "RESULTS=None" >> $GITHUB_ENV else - RESULTS=$(echo "${{ env.CHANGED_FILES }}" | xargs radon cc -s -n A) - echo "RESULTS=$RESULTS" >> $GITHUB_ENV + RESULTS=$(echo "${{ env.CHANGED_FILES }}" | xargs radon cc -s -n A || true) + echo "RESULTS<> $GITHUB_ENV + echo "$RESULTS" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV fi - name: Comment on PR From 59fd976b8c45401087bcc802205fc0003e383bab Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:25:58 -0500 Subject: [PATCH 30/36] Add granular Radon analysis workflow for method-level change detection --- .github/workflows/radon-anylsis-granular.yml | 79 ++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/radon-anylsis-granular.yml diff --git a/.github/workflows/radon-anylsis-granular.yml b/.github/workflows/radon-anylsis-granular.yml new file mode 100644 index 00000000..c5ba2d6e --- /dev/null +++ b/.github/workflows/radon-anylsis-granular.yml @@ -0,0 +1,79 @@ +name: Radon Analysis (Granular) + +on: + pull_request: + paths: + - '**/*.py' # Only trigger for Python files + +jobs: + radon_analysis: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Ensure full history is fetched for git diff to work properly + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: pip install radon + + - name: Get changed lines + id: get_changed_lines + run: | + git diff -U0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -E '^\+\+\+|^\+\d' > changed_lines.diff + echo "Changed lines:" + cat changed_lines.diff + + - name: Parse changed methods + id: parse_methods + run: | + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py$' || true) + echo "Analyzing methods in changed files: $CHANGED_FILES" + + RESULTS="" + for FILE in $CHANGED_FILES; do + echo "Processing file: $FILE" + METHODS=$(radon cc $FILE -s | awk '/^ / {print $NF}') + echo "Methods found: $METHODS" + + # Map changes to specific methods + while IFS= read -r LINE; do + if [[ $LINE == *"$FILE"* ]]; then + LINE_NUMBER=$(echo $LINE | grep -oP '(?<=\+)\d+') + MATCHING_METHOD=$(radon cc $FILE -s | awk -v line=$LINE_NUMBER '{ + if ($1 ~ /^[0-9]+:/ && $1 <= line) method=$NF; + if ($1 > line) { print method; exit } + }') + RESULTS+="$MATCHING_METHOD (in $FILE)\n" + fi + done <<< "$(cat changed_lines.diff)" + done + echo -e "$RESULTS" > results.txt + echo "RESULTS<> $GITHUB_ENV + cat results.txt >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Debug results + run: | + echo "Granular results:" + cat results.txt + + - name: Comment on PR + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Radon Method-Level Analysis + message: | + **Radon Analysis Results:** + ``` + ${{ env.RESULTS }} + ``` + + - name: Log if no methods found + if: env.RESULTS == '' + run: echo "No methods found with changes in this PR." From 85b0643a9f4ab240fa0b0f550d52737efebe5598 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:27:51 -0500 Subject: [PATCH 31/36] Refine Radon analysis workflow to accurately match methods with changed lines and avoid duplicates --- .github/workflows/radon-anylsis-granular.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-anylsis-granular.yml b/.github/workflows/radon-anylsis-granular.yml index c5ba2d6e..e14560be 100644 --- a/.github/workflows/radon-anylsis-granular.yml +++ b/.github/workflows/radon-anylsis-granular.yml @@ -39,18 +39,26 @@ jobs: RESULTS="" for FILE in $CHANGED_FILES; do echo "Processing file: $FILE" - METHODS=$(radon cc $FILE -s | awk '/^ / {print $NF}') + + # Get method names and their line numbers + METHODS=$(radon cc $FILE -s | grep -oP "^\s*\d+.*\K[^\(]+" || true) echo "Methods found: $METHODS" - # Map changes to specific methods + # Extract the lines that are changed in this file while IFS= read -r LINE; do if [[ $LINE == *"$FILE"* ]]; then LINE_NUMBER=$(echo $LINE | grep -oP '(?<=\+)\d+') + + # Match the method based on line number MATCHING_METHOD=$(radon cc $FILE -s | awk -v line=$LINE_NUMBER '{ if ($1 ~ /^[0-9]+:/ && $1 <= line) method=$NF; if ($1 > line) { print method; exit } }') - RESULTS+="$MATCHING_METHOD (in $FILE)\n" + + # Append method results + if [[ ! " ${RESULTS[@]} " =~ " ${MATCHING_METHOD} " ]]; then + RESULTS+="$MATCHING_METHOD\n" + fi fi done <<< "$(cat changed_lines.diff)" done From 7657fa46a9e4d12f3e49ff73105e98d7708389cc Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:32:25 -0500 Subject: [PATCH 32/36] Refine Radon analysis workflow to capture raw output and improve method detection --- .github/workflows/radon-anylsis-granular.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/radon-anylsis-granular.yml b/.github/workflows/radon-anylsis-granular.yml index e14560be..7324cd8b 100644 --- a/.github/workflows/radon-anylsis-granular.yml +++ b/.github/workflows/radon-anylsis-granular.yml @@ -40,8 +40,13 @@ jobs: for FILE in $CHANGED_FILES; do echo "Processing file: $FILE" - # Get method names and their line numbers - METHODS=$(radon cc $FILE -s | grep -oP "^\s*\d+.*\K[^\(]+" || true) + # Run radon cc and check the raw output + RADON_OUTPUT=$(radon cc $FILE -s || true) + echo "Raw Radon Output for $FILE:" + echo "$RADON_OUTPUT" + + # Check if there are methods in the output + METHODS=$(echo "$RADON_OUTPUT" | grep -oP "^\s*\d+.*\K[^\(]+" || true) echo "Methods found: $METHODS" # Extract the lines that are changed in this file @@ -50,7 +55,7 @@ jobs: LINE_NUMBER=$(echo $LINE | grep -oP '(?<=\+)\d+') # Match the method based on line number - MATCHING_METHOD=$(radon cc $FILE -s | awk -v line=$LINE_NUMBER '{ + MATCHING_METHOD=$(echo "$RADON_OUTPUT" | awk -v line=$LINE_NUMBER '{ if ($1 ~ /^[0-9]+:/ && $1 <= line) method=$NF; if ($1 > line) { print method; exit } }') From a820a13bcfa134c9c477cfe4743f995012f47d4b Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:33:51 -0500 Subject: [PATCH 33/36] Remove granular Radon analysis workflow configuration --- .github/workflows/radon-anylsis-granular.yml | 92 -------------------- 1 file changed, 92 deletions(-) delete mode 100644 .github/workflows/radon-anylsis-granular.yml diff --git a/.github/workflows/radon-anylsis-granular.yml b/.github/workflows/radon-anylsis-granular.yml deleted file mode 100644 index 7324cd8b..00000000 --- a/.github/workflows/radon-anylsis-granular.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Radon Analysis (Granular) - -on: - pull_request: - paths: - - '**/*.py' # Only trigger for Python files - -jobs: - radon_analysis: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Ensure full history is fetched for git diff to work properly - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - - name: Install dependencies - run: pip install radon - - - name: Get changed lines - id: get_changed_lines - run: | - git diff -U0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -E '^\+\+\+|^\+\d' > changed_lines.diff - echo "Changed lines:" - cat changed_lines.diff - - - name: Parse changed methods - id: parse_methods - run: | - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py$' || true) - echo "Analyzing methods in changed files: $CHANGED_FILES" - - RESULTS="" - for FILE in $CHANGED_FILES; do - echo "Processing file: $FILE" - - # Run radon cc and check the raw output - RADON_OUTPUT=$(radon cc $FILE -s || true) - echo "Raw Radon Output for $FILE:" - echo "$RADON_OUTPUT" - - # Check if there are methods in the output - METHODS=$(echo "$RADON_OUTPUT" | grep -oP "^\s*\d+.*\K[^\(]+" || true) - echo "Methods found: $METHODS" - - # Extract the lines that are changed in this file - while IFS= read -r LINE; do - if [[ $LINE == *"$FILE"* ]]; then - LINE_NUMBER=$(echo $LINE | grep -oP '(?<=\+)\d+') - - # Match the method based on line number - MATCHING_METHOD=$(echo "$RADON_OUTPUT" | awk -v line=$LINE_NUMBER '{ - if ($1 ~ /^[0-9]+:/ && $1 <= line) method=$NF; - if ($1 > line) { print method; exit } - }') - - # Append method results - if [[ ! " ${RESULTS[@]} " =~ " ${MATCHING_METHOD} " ]]; then - RESULTS+="$MATCHING_METHOD\n" - fi - fi - done <<< "$(cat changed_lines.diff)" - done - echo -e "$RESULTS" > results.txt - echo "RESULTS<> $GITHUB_ENV - cat results.txt >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Debug results - run: | - echo "Granular results:" - cat results.txt - - - name: Comment on PR - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: Radon Method-Level Analysis - message: | - **Radon Analysis Results:** - ``` - ${{ env.RESULTS }} - ``` - - - name: Log if no methods found - if: env.RESULTS == '' - run: echo "No methods found with changes in this PR." From be07de784c74a2d226cd93d15d8f916805c38993 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:36:15 -0500 Subject: [PATCH 34/36] wip --- .github/workflows/radon-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/radon-analysis.yml b/.github/workflows/radon-analysis.yml index 609bb2bd..f81c58e4 100644 --- a/.github/workflows/radon-analysis.yml +++ b/.github/workflows/radon-analysis.yml @@ -38,7 +38,7 @@ jobs: shell: bash - name: Run Radon analysis - id: radon_analysis + id: radon_analysis run: | if [ -z "${{ env.CHANGED_FILES }}" ]; then echo "No Python files changed." From bb2317b5d9e1f6becc074d4c1a639c8f3d67bf31 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:37:52 -0500 Subject: [PATCH 35/36] test --- src/masoniteorm/commands/MakeMigrationCommand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masoniteorm/commands/MakeMigrationCommand.py b/src/masoniteorm/commands/MakeMigrationCommand.py index f62aea42..bcebaf2d 100644 --- a/src/masoniteorm/commands/MakeMigrationCommand.py +++ b/src/masoniteorm/commands/MakeMigrationCommand.py @@ -12,7 +12,7 @@ class MakeMigrationCommand(Command): Creates a new migration file. migration - {name : The name of the migration} + {name : The name of the migration} {--c|create=None : The table to create} {--t|table=None : The table to alter} {--d|directory=databases/migrations : The location of the migration directory} From 0fd07449501ee619fb3691bab6985c4e647165c7 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Wed, 20 Nov 2024 19:47:48 -0500 Subject: [PATCH 36/36] Remove commented test line and clean up migration command help text formatting --- src/masoniteorm/collection/Collection.py | 1 - src/masoniteorm/commands/MakeMigrationCommand.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/masoniteorm/collection/Collection.py b/src/masoniteorm/collection/Collection.py index a24e98af..e238db8a 100644 --- a/src/masoniteorm/collection/Collection.py +++ b/src/masoniteorm/collection/Collection.py @@ -542,7 +542,6 @@ def __getitem__(self, item): return None def __setitem__(self, key, value): - # test self._items[key] = value def __delitem__(self, key): diff --git a/src/masoniteorm/commands/MakeMigrationCommand.py b/src/masoniteorm/commands/MakeMigrationCommand.py index bcebaf2d..f62aea42 100644 --- a/src/masoniteorm/commands/MakeMigrationCommand.py +++ b/src/masoniteorm/commands/MakeMigrationCommand.py @@ -12,7 +12,7 @@ class MakeMigrationCommand(Command): Creates a new migration file. migration - {name : The name of the migration} + {name : The name of the migration} {--c|create=None : The table to create} {--t|table=None : The table to alter} {--d|directory=databases/migrations : The location of the migration directory}