s403o / Djangoline

Djangoline is a simple blog built with Django Framework.
0 stars 0 forks source link

Sweep: make a CI\CD using Github Actions for linting (using flake8) and building the Django app #6

Open s403o opened 11 months ago

s403o commented 11 months ago

Details

Checklist - [X] `.github/workflows/ci_cd.yml` ✅ Commit [`7e31a41`](https://github.com/s403o/Djangoline/commit/7e31a410520a451b2c61aa63aac50ce882d17b0c) - [X] `.flake8` ✅ Commit [`1d69bed`](https://github.com/s403o/Djangoline/commit/1d69bed76b0eaf1150a6deefb2e150013a208854) - [X] `.pre-commit-config.yaml` ✅ Commit [`ded6b39`](https://github.com/s403o/Djangoline/commit/ded6b39357fc9ec2d02ef740dd1848a42a13546e) - [X] `requirements.txt` ✅ Commit [`266f859`](https://github.com/s403o/Djangoline/commit/266f859549a8926dc385fe7df30820c219770057)
sweep-ai[bot] commented 11 months ago

Here's the PR! https://github.com/s403o/Djangoline/pull/8.

⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal.

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/s403o/Djangoline/blob/66166b87a20bc13aa0c0eed1f34022933a2a6d2e/my_site/blog/migrations/0001_initial.py#L1-L45 https://github.com/s403o/Djangoline/blob/66166b87a20bc13aa0c0eed1f34022933a2a6d2e/my_site/my_site/settings.py#L1-L128 https://github.com/s403o/Djangoline/blob/66166b87a20bc13aa0c0eed1f34022933a2a6d2e/README.md#L1-L1 https://github.com/s403o/Djangoline/blob/66166b87a20bc13aa0c0eed1f34022933a2a6d2e/sweep.yaml#L1-L11 https://github.com/s403o/Djangoline/blob/66166b87a20bc13aa0c0eed1f34022933a2a6d2e/my_site/my_site/wsgi.py#L1-L15

Step 2: ⌨️ Coding

trunk init 1/5 ✓
⡿ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
⣷ Downloading Trunk 1.16.2...
⣯ Downloading Trunk 1.16.2...
⣟ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
✔ Downloading Trunk 1.16.2... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 16 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.26 (1 github-workflow file)
  bandit 1.7.5 (16 python files)
  black 23.9.1 (13 python files)
  checkov 2.4.9 (1 docker, 6 yaml files)
  git-diff-check (56 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (16 python files) (created .isort.cfg)
  markdownlint 0.37.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (6 png files)
  prettier 3.0.3 (6 css, 6 html, 1 markdown, 6 yaml files)
  ruff 0.0.291 (16 python files) (created ruff.toml)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 6 yaml files)
  trufflehog 3.57.0 (56 files)
  yamllint 1.32.0 (6 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt .github/workflows/ci_cd.yml 2/5 ✓

 ✔ Formatted .github/workflows/ci_cd.yml
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix .github/workflows/ci_cd.yml 3/5 ❌ (`1`)

  ISSUES  
.github/workflows/ci_cd.yml:1:1
 1:1  high  Ensure top-level permissions are not set to write-all  checkov/CKV2_GHA_1
Checked 1 file
✖ 1 new issue
Run trunk upgrade to upgrade 1 linter
trunk fmt .github/workflows/ci_cd.yml 4/5 ✓

 ✔ Formatted .github/workflows/ci_cd.yml
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix .github/workflows/ci_cd.yml 5/5 ✓

Checked 1 file
✔ No issues

trunk init 1/3 ✓
⡿ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
⣷ Downloading Trunk 1.16.2...
⣯ Downloading Trunk 1.16.2...
⣟ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
✔ Downloading Trunk 1.16.2... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 16 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (16 python files)
  black 23.9.1 (13 python files)
  checkov 2.4.9 (1 docker, 5 yaml files)
  flake8 6.1.0 (16 python files)
  git-diff-check (56 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (16 python files) (created .isort.cfg)
  markdownlint 0.37.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (6 png files)
  prettier 3.0.3 (6 css, 6 html, 1 markdown, 5 yaml files)
  ruff 0.0.291 (16 python files) (created ruff.toml)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 5 yaml files)
  trufflehog 3.57.0 (56 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt .flake8 2/3 ✓

Found no applicable linters for the requested path
trunk check --fix .flake8 3/3 ✓

Checked 1 file
✔ No issues

trunk init 1/3 ✓
⡿ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
⣷ Downloading Trunk 1.16.2...
⣯ Downloading Trunk 1.16.2...
⣟ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
✔ Downloading Trunk 1.16.2... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 15 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (16 python files)
  black 23.9.1 (13 python files)
  checkov 2.4.9 (1 docker, 6 yaml files)
  git-diff-check (56 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (16 python files) (created .isort.cfg)
  markdownlint 0.37.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (6 png files)
  prettier 3.0.3 (6 css, 6 html, 1 markdown, 6 yaml files)
  ruff 0.0.291 (16 python files) (created ruff.toml)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 1 lockfile, 6 yaml files)
  trufflehog 3.57.0 (56 files)
  yamllint 1.32.0 (6 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt .pre-commit-config.yaml 2/3 ✓

 ✔ Formatted .pre-commit-config.yaml
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix .pre-commit-config.yaml 3/3 ✓

Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter

trunk init 1/3 ✓
⡿ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
⣷ Downloading Trunk 1.16.2...
⣯ Downloading Trunk 1.16.2...
⣟ Downloading Trunk 1.16.2...
⡿ Downloading Trunk 1.16.2...
⢿ Downloading Trunk 1.16.2...
⣻ Downloading Trunk 1.16.2...
⣽ Downloading Trunk 1.16.2...
⣾ Downloading Trunk 1.16.2...
✔ Downloading Trunk 1.16.2... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 15 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (16 python files)
  black 23.9.1 (13 python files)
  checkov 2.4.9 (1 docker, 5 yaml files)
  git-diff-check (56 files)
  hadolint 2.12.0 (1 docker file) (created .hadolint.yaml)
  isort 5.12.0 (16 python files) (created .isort.cfg)
  markdownlint 0.37.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (2 lockfile files)
  oxipng 8.0.0 (6 png files)
  prettier 3.0.3 (6 css, 6 html, 1 markdown, 5 yaml files)
  ruff 0.0.291 (16 python files) (created ruff.toml)
  terrascan 1.18.3 (1 docker file)
  trivy 0.45.1 (1 docker, 2 lockfile, 5 yaml files)
  trufflehog 3.57.0 (56 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt requirements.txt 2/3 ✓

Found no applicable linters for the requested path
trunk check --fix requirements.txt 3/3 ✓

Checked 1 file
✔ No issues


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add-ci-cd.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord

s403o commented 11 months ago

Sweep: Fix building step