obirler / Shapes

This is a test repository for measuring Sweep ai bot skills
0 stars 0 forks source link

Sweep: Create a class to generate desired shaped using factory design pattern #50

Closed obirler closed 1 year ago

obirler commented 1 year ago
Checklist - [X] `Shapes.Library/ShapeFactory.cs` ✅ Commit [`abc093d`](https://github.com/obirler/Shapes/commit/abc093d168666ae772fb80a8676042571fd63ed9)
• Create a new class named "ShapeFactory" with a static method "CreateShape" that takes a string parameter and returns an instance of the corresponding shape class.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 8 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  checkov 2.4.9 (3 yaml files)
  git-diff-check (29 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  trivy 0.45.1 (3 yaml files)
  trufflehog 3.56.1 (29 files)
  yamllint 1.32.0 (3 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 Shapes.Library/ShapeFactory.cs 2/3 ✓

Found no applicable linters for the requested path
trunk check --fix Shapes.Library/ShapeFactory.cs 3/3 ✓

Checked 1 file
✔ No issues
- [X] `Shapes.Library/ShapeFactory.cs` ✅ Commit [`abc093d`](https://github.com/obirler/Shapes/commit/abc093d168666ae772fb80a8676042571fd63ed9)
• Add a switch statement inside the CreateShape method to handle different shape types and instantiate the corresponding shape class based on the input.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 8 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  checkov 2.4.9 (3 yaml files)
  git-diff-check (29 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  trivy 0.45.1 (3 yaml files)
  trufflehog 3.56.1 (29 files)
  yamllint 1.32.0 (3 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 Shapes.Library/ShapeFactory.cs 2/3 ✓

Found no applicable linters for the requested path
trunk check --fix Shapes.Library/ShapeFactory.cs 3/3 ✓

Checked 1 file
✔ No issues
- [X] `README.md` ✅ Commit [`3d220de`](https://github.com/obirler/Shapes/commit/3d220de086048b10a42de885da8edd56dddbdadb)
• Add instructions on how to use the ShapeFactory class to generate desired shapes.
Sandbox Execution Logs
trunk init 1/11 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 8 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  checkov 2.4.9 (3 yaml files)
  git-diff-check (28 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  trivy 0.45.1 (3 yaml files)
  trufflehog 3.56.1 (28 files)
  yamllint 1.32.0 (3 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 README.md 2/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 3/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 41:0  low  Ordered list item prefix  markdownlint/MD029
 46:0  low  Ordered list item prefix  markdownlint/MD029
 47:0  low  Ordered list item prefix  markdownlint/MD029
 48:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 6 new issues
trunk fmt README.md 4/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 5/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 41:0  low  Ordered list item prefix  markdownlint/MD029
 46:0  low  Ordered list item prefix  markdownlint/MD029
 47:0  low  Ordered list item prefix  markdownlint/MD029
 48:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 6 new issues
trunk fmt README.md 6/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 7/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 41:0  low  Ordered list item prefix  markdownlint/MD029
 46:0  low  Ordered list item prefix  markdownlint/MD029
 48:0  low  Ordered list item prefix  markdownlint/MD029
 50:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 6 new issues
trunk fmt README.md 8/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 9/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 40:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 3 new issues
trunk fmt README.md 10/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 11/11 ✓

Checked 1 file
✔ No issues
sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/obirler/Shapes/pull/51.

⚡ Sweep Free Trial: I used GPT-3.5 to create this ticket. You have 0 GPT-4 tickets left for the month and 0 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/obirler/Shapes/blob/9c8f31fa5c97915b3ece85f66b1da8d87774ad45/Shapes.VBLibrary/Shape.vb#L1-L6 https://github.com/obirler/Shapes/blob/9c8f31fa5c97915b3ece85f66b1da8d87774ad45/README.md#L1-L48

Step 2: ⌨️ Coding

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

✔ 8 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  checkov 2.4.9 (3 yaml files)
  git-diff-check (29 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  trivy 0.45.1 (3 yaml files)
  trufflehog 3.56.1 (29 files)
  yamllint 1.32.0 (3 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 Shapes.Library/ShapeFactory.cs 2/3 ✓

Found no applicable linters for the requested path
trunk check --fix Shapes.Library/ShapeFactory.cs 3/3 ✓

Checked 1 file
✔ No issues

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

✔ 8 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  checkov 2.4.9 (3 yaml files)
  git-diff-check (29 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  trivy 0.45.1 (3 yaml files)
  trufflehog 3.56.1 (29 files)
  yamllint 1.32.0 (3 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 Shapes.Library/ShapeFactory.cs 2/3 ✓

Found no applicable linters for the requested path
trunk check --fix Shapes.Library/ShapeFactory.cs 3/3 ✓

Checked 1 file
✔ No issues

trunk init 1/11 ✓
⡿ Downloading Trunk 1.16.0...
⡿ Downloading Trunk 1.16.0...
⢿ Downloading Trunk 1.16.0...
⣻ Downloading Trunk 1.16.0...
⣽ Downloading Trunk 1.16.0...
⣾ Downloading Trunk 1.16.0...
⣷ Downloading Trunk 1.16.0...
✔ Downloading Trunk 1.16.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 8 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.25 (1 github-workflow file)
  checkov 2.4.9 (3 yaml files)
  git-diff-check (28 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 3 yaml files)
  trivy 0.45.1 (3 yaml files)
  trufflehog 3.56.1 (28 files)
  yamllint 1.32.0 (3 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 README.md 2/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 3/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 41:0  low  Ordered list item prefix  markdownlint/MD029
 46:0  low  Ordered list item prefix  markdownlint/MD029
 47:0  low  Ordered list item prefix  markdownlint/MD029
 48:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 6 new issues
trunk fmt README.md 4/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 5/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 41:0  low  Ordered list item prefix  markdownlint/MD029
 46:0  low  Ordered list item prefix  markdownlint/MD029
 47:0  low  Ordered list item prefix  markdownlint/MD029
 48:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 6 new issues
trunk fmt README.md 6/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 7/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 41:0  low  Ordered list item prefix  markdownlint/MD029
 46:0  low  Ordered list item prefix  markdownlint/MD029
 48:0  low  Ordered list item prefix  markdownlint/MD029
 50:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 6 new issues
trunk fmt README.md 8/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 9/11 ❌ (`1`)

  ISSUES  
README.md:31:0
 31:0  low  Ordered list item prefix  markdownlint/MD029
 35:0  low  Ordered list item prefix  markdownlint/MD029
 40:0  low  Ordered list item prefix  markdownlint/MD029
Checked 1 file
✖ 3 new issues
trunk fmt README.md 10/11 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 11/11 ✓

Checked 1 file
✔ No issues


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/shape-factory.

.


🎉 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

obirler commented 1 year ago

Use parameter array to create shapes in the factory