From 51fd96c08d1e322743c826862f5f98b21e99d02d Mon Sep 17 00:00:00 2001 From: Carlos Paredes Date: Tue, 26 Mar 2024 22:25:57 -0300 Subject: [PATCH] badcode --- .github/workflows/condor_review.yml | 24 ++++++++++++++++++++++++ bad_code.js | 9 +++++++++ c.py | 18 ++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .github/workflows/condor_review.yml create mode 100644 bad_code.js create mode 100644 c.py diff --git a/.github/workflows/condor_review.yml b/.github/workflows/condor_review.yml new file mode 100644 index 0000000..f624a41 --- /dev/null +++ b/.github/workflows/condor_review.yml @@ -0,0 +1,24 @@ +name: Condor Code Review + +on: [pull_request] + +jobs: + review: + 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.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install condor_code_reviewer + + - name: Run Condor + run: condor --openai-key ${{ secrets.OPENAI_KEY }} --gh-api-key ${{ secrets.GH_API_KEY }} --assistant-id ${{ secrets.ASSISTANT_ID }} --pull-request-url ${{ github.event.pull_request.html_url }} diff --git a/bad_code.js b/bad_code.js new file mode 100644 index 0000000..eb75a3c --- /dev/null +++ b/bad_code.js @@ -0,0 +1,9 @@ +function add(num1, num2) { + if (typeof num1 == 'number' && typeof num2 == 'number') { + return num1 + num2; + } else { + return 'Error: Both inputs must be numbers'; + } + } + + console.log(add(1, '2')); // This will return 'Error: Both inputs must be numbers' diff --git a/c.py b/c.py new file mode 100644 index 0000000..82840c9 --- /dev/null +++ b/c.py @@ -0,0 +1,18 @@ +def bad_code(): + a = [1, 2, 3, 4, 5] + b = [6, 7, 8, 9, 10] + c = [] + for i in range(len(a)): + for j in range(len(b)): + if i == j: + c.append(a[i] + b[j]) + print(c) + + d = "Hello, World!" + e = d.split(" ") + f = "" + for g in e: + f += g + print(f) + +bad_code()