eranheres / cli_snake_game_self

0 stars 0 forks source link

Add light green color support for snake head #36

Open sweep-mine[bot] opened 11 months ago

sweep-mine[bot] commented 11 months ago

Description

This PR adds support for changing the color of the snake's head to light green in the command-line snake game. It introduces the colorama library to enable colored console output and modifies the Snake class to incorporate the new color attribute.

Summary

Fixes #32.


πŸŽ‰ Latest improvements to Sweep:


πŸ’‘ To get Sweep to edit this pull request, you can:

sweep-mine[bot] commented 11 months ago

Sandbox Executions

trunk fmt cli_snake_game/snake.py || return 0 1/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 2/19 βœ“
  ISSUES  
cli_snake_game/snake.py:7:30
  7:30  high  Do not use mutable data structures for argument defaults                                 ruff/B006  
 43:0   low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
Checked 1 file
2 existing issues (1 auto-fixable)
pytest 3/19 βœ“
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0
rootdir: /repo
collected 4 items
tests/test_empty.py .                                                    [ 25%]
tests/test_food.py ...                                                   [100%]
============================== 4 passed in 0.04s ===============================
trunk fmt cli_snake_game/snake.py || return 0 4/19 ❌ (`2`)
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

  FAILURES  
 black  cli_snake_game/snake.py  .trunk/out/xiUl4.yaml
 black  cli_snake_game/snake.py  .trunk/out/LrAQV.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
βœ– No issues, 2 failures
bash: line 1: return: can only `return' from a function or sourced script
trunk fmt cli_snake_game/snake.py || return 0 5/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 6/19 ❌ (`1`)
 βœ” Auto-fixed cli_snake_game/snake.py
Re-checking autofixed files...

  ISSUES  
cli_snake_game/snake.py:75:7
  9:30  high  Do not use mutable data structures for argument defaults                                 ruff/B006  
 47:0   low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
 75:7   high  Redefinition of unused `Food` from line 42                                               ruff/F811  
 80:0   low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
Checked 1 file
2 existing issues (1 auto-fixable)
βœ– 2 new issues
trunk fmt cli_snake_game/snake.py || return 0 7/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 8/19 ❌ (`1`)
 βœ” Auto-fixed cli_snake_game/snake.py
Re-checking autofixed files...

  ISSUES  
cli_snake_game/snake.py:73:7
 45:0  low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
 73:7  high  Redefinition of unused `Food` from line 40                                               ruff/F811  
 78:0  low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
Checked 1 file
1 existing issue
βœ– 2 new issues
trunk fmt cli_snake_game/snake.py || return 0 9/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 10/19 ❌ (`1`)
 βœ” Auto-fixed cli_snake_game/snake.py
Re-checking autofixed files...

  ISSUES  
cli_snake_game/snake.py:73:7
 45:0  low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
 73:7  high  Redefinition of unused `Food` from line 40                                               ruff/F811  
 78:0  low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
Checked 1 file
1 existing issue
βœ– 2 new issues
trunk fmt cli_snake_game/snake.py || return 0 11/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 12/19 ❌ (`1`)
 βœ” Auto-fixed cli_snake_game/snake.py
Re-checking autofixed files...

  ISSUES  
cli_snake_game/snake.py:47:26
 47:26  high  Undefined name `secrets`                                                                 ruff/F821  
 47:54  high  Undefined name `secrets`                                                                 ruff/F821  
 75:7   high  Redefinition of unused `Food` from line 40                                               ruff/F811  
 80:0   low   Standard pseudo-random generators are not suitable for security/cryptographic purposes.  bandit/B311
Checked 1 file
1 existing issue
βœ– 3 new issues
trunk fmt cli_snake_game/snake.py || return 0 13/19 ❌ (`2`)
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

  FAILURES  
 black  cli_snake_game/snake.py  .trunk/out/8bofd.yaml
 black  cli_snake_game/snake.py  .trunk/out/FgXPN.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
βœ– No issues, 2 failures
bash: line 1: return: can only `return' from a function or sourced script
trunk fmt cli_snake_game/snake.py || return 0 14/19 ❌ (`2`)
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

  FAILURES  
 black  cli_snake_game/snake.py  .trunk/out/tembR.yaml
 black  cli_snake_game/snake.py  .trunk/out/ycdaj.yaml
  NOTICES  
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
βœ– No issues, 2 failures
bash: line 1: return: can only `return' from a function or sourced script
trunk fmt cli_snake_game/snake.py || return 0 15/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 16/19 ❌ (`1`)
 βœ” Auto-fixed cli_snake_game/snake.py
Re-checking autofixed files...

  ISSUES  
cli_snake_game/snake.py:49:7
 49:7  high  Redefinition of unused `Food` from line 40  ruff/F811
Checked 1 file
βœ– 1 new issue
trunk fmt cli_snake_game/snake.py || return 0 17/19 βœ“
 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

 βœ” Formatted cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
trunk check --fix --print-failures cli_snake_game/snake.py 18/19 βœ“
 βœ” Auto-fixed cli_snake_game/snake.py
Re-checking autofixed files...

Checked 1 file
βœ” No issues
pytest 19/19 βœ“
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0
rootdir: /repo
collected 4 items
tests/test_empty.py .                                                    [ 25%]
tests/test_food.py ...                                                   [100%]
============================== 4 passed in 0.03s ===============================

trunk fmt requirements.txt || return 0 1/6 βœ“
Found no applicable linters for the requested path
trunk check --fix --print-failures requirements.txt 2/6 βœ“
Checked 1 file
βœ” No issues
pytest 3/6 βœ“
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0
rootdir: /repo
collected 4 items
tests/test_empty.py .                                                    [ 25%]
tests/test_food.py ...                                                   [100%]
============================== 4 passed in 0.05s ===============================
trunk fmt requirements.txt || return 0 4/6 βœ“
Found no applicable linters for the requested path
trunk check --fix --print-failures requirements.txt 5/6 βœ“
Checked 1 file
βœ” No issues
pytest 6/6 βœ“
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0
rootdir: /repo
collected 4 items
tests/test_empty.py .                                                    [ 25%]
tests/test_food.py ...                                                   [100%]
============================== 4 passed in 0.04s ===============================

sweep-mine[bot] commented 11 months ago

Apply Sweep Rules to your PR?