eranheres / ultra_type

0 stars 0 forks source link

Sweep: change the view module to work with curses library #28

Closed eranheres closed 9 months ago

eranheres commented 9 months ago
Checklist - [X] Modify `ultra_type/view.py` ✓ https://github.com/eranheres/ultra_type/commit/016445c242c90363d406580153e975916c31fb8a - [X] Ran sandbox for `ultra_type/view.py`. ✓ - [X] Modify `ultra_type/view.py` ✓ https://github.com/eranheres/ultra_type/commit/1899aec5978e25bc9559fd60b3b0b835d6d94484 - [X] Ran sandbox for `ultra_type/view.py`. ✗ - [X] Modify `ultra_type/view.py` ✓ https://github.com/eranheres/ultra_type/commit/d520921f1e6b33ad016ea9a379a7ebd6de72f50d - [X] Ran sandbox for `ultra_type/view.py`. ✗ - [X] Modify `ultra_type/view.py` ✓ https://github.com/eranheres/ultra_type/commit/8cb7c3cb693df3d7c817008708e0318d44490471 - [X] Ran sandbox for `ultra_type/view.py`. ✓ - [X] Modify `ultra_type/view.py` ✓ https://github.com/eranheres/ultra_type/commit/1fef815696756bbc39d5576918095525cf405348 - [X] Ran sandbox for `ultra_type/view.py`. ✓ - [X] Modify `ultra_type/controller.py` ✓ https://github.com/eranheres/ultra_type/commit/13e02ea232b1c7cad160c74df3eeeefc0fdc8d6c - [X] Ran sandbox for `ultra_type/controller.py`. ✓ ![Flowchart](https://raw.githubusercontent.com/eranheres/ultra_type/sweep/assets/7a9c34b80bfb5899a5731597f116f71a060700190bcda0280e43f609332e0e20_28_flowchart.svg)
sweep-mine[bot] commented 9 months ago

Here's the PR! https://github.com/eranheres/ultra_type/pull/29.

💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: efb33ccfc0)

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 86c9af7
poetry install 1/1 ✓
Creating virtualenv ultra-type-gW_DSdP6-py3.10 in /root/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...
Package operations: 14 installs, 0 updates, 0 removals
  • Installing typing-extensions (4.8.0)
  • Installing astroid (3.0.1)
  • Installing dill (0.3.7)
  • Installing exceptiongroup (1.2.0)
  • Installing iniconfig (2.0.0)
  • Installing isort (5.12.0)
  • Installing mccabe (0.7.0)
  • Installing packaging (23.2)
  • Installing platformdirs (4.0.0)
  • Installing pluggy (1.3.0)
  • Installing tomli (2.0.1)
  • Installing tomlkit (0.12.3)
  • Installing pylint (3.0.2)
  • Installing pytest (7.4.3)
Writing lock file
Installing the current project: ultra-type (0.1.0)

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


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/eranheres/ultra_type/blob/86c9af7aa1d91478dd9c5664eae43d2c4f1849a4/README.md#L1-L20 https://github.com/eranheres/ultra_type/blob/86c9af7aa1d91478dd9c5664eae43d2c4f1849a4/ultra_type/controller.py#L1-L32 https://github.com/eranheres/ultra_type/blob/86c9af7aa1d91478dd9c5664eae43d2c4f1849a4/pyproject.toml#L1-L15 https://github.com/eranheres/ultra_type/blob/86c9af7aa1d91478dd9c5664eae43d2c4f1849a4/ultra_type/__init__.py#L1-L-1

Step 2: ⌨️ Coding

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)

poetry run pylint -E **/*.py 1/1 ❌ (`2`)
************* Module ultra_type.view
ultra_type/view.py:16:4: E0001: Parsing failed: 'unexpected indent (, line 16)' (syntax-error)
************* Module ultra_type.controller
ultra_type/controller.py:2:0: E0001: Cannot import 'ultra_type.view' due to 'unexpected indent (, line 16)' (syntax-error)
ultra_type/controller.py:2:0: E0611: No name 'view' in module 'ultra_type' (no-name-in-module)
************* Module ultra_type.main
ultra_type/main.py:2:0: E0001: Cannot import 'ultra_type.view' due to 'unexpected indent (, line 16)' (syntax-error)
ultra_type/main.py:2:0: E0611: No name 'view' in module 'ultra_type' (no-name-in-module)

poetry run pylint -E **/*.py 1/1 ❌ (`2`)
************* Module ultra_type.view
ultra_type/view.py:3:15: E1101: Instance of 'View' has no 'stdscr' member (no-member)
ultra_type/view.py:6:8: E1101: Instance of 'View' has no 'stdscr' member (no-member)
ultra_type/view.py:7:8: E1101: Instance of 'View' has no 'stdscr' member (no-member)
ultra_type/view.py:8:15: E1101: Instance of 'View' has no 'stdscr' member (no-member)

In the 'get_user_input' and 'get_language_choice' methods, replace the 'input()' function calls with 'self.stdscr.getstr().decode('utf-8')'. This will get the user input from the terminal using the 'stdscr' object.

In the 'get_language_choice' method, replace the 'print' function call with 'self.stdscr.addstr' and 'self.stdscr.refresh'. This will display the text on the terminal using the 'stdscr' object.

In the 'display_word' and 'display_stats' methods, replace the 'print' function calls with 'self.stdscr.addstr' and 'self.stdscr.refresh'. This will display the word and stats on the terminal using the 'stdscr' object.

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)


Step 3: 🔁 Code Review

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


🎉 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