Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planned refactors for 2021. #49

Open
15 of 21 tasks
HexDecimal opened this issue Jun 17, 2021 · 1 comment
Open
15 of 21 tasks

Planned refactors for 2021. #49

HexDecimal opened this issue Jun 17, 2021 · 1 comment
Assignees

Comments

@HexDecimal
Copy link
Collaborator

HexDecimal commented Jun 17, 2021

I plan on making several changes to how the code is formatted and how errors are checked. Enforcing a constant formatting makes committing changes with Git easier. Tools that enforce error checking will prevent regressions in the tutorial code.

Other changes are to fix complaints people have had with the tutorial. Such as issues caused by the complexity of TYPE_CHECKING and how the tutorial does not go into how to make binary releases of the project.

  • Update .gitignore and .gitattributes files to use common settings.
  • Use Black and isort for consistent formatting. Line length will be set to 120.
  • Try adding other Python linters: MyPy, Flake8, pylint.
  • Setup PyInstaller early on in the tutorial so that deployable builds are available immediately.
  • Remove reliance on TYPE_CHECKING. First-party from-imports will only be for objects required at import-time. isort will have from_first=true enabled. This works the best at removing issues from cyclic importing wherever they can't be resolved completely. Type checking is still needed, but its use will be more limited.
  • Reorder most modules into sub-packages, so that there are far fewer top-level modules which should reduce name shadowing.
  • Add GitHub workflows which will enforce the above linters and verify deployments.
  • Add VS Code workspace settings for the above. This will be the easiest method to modify the tutorial by contributors, since PyCharm doesn't support workspace settings very well.
  • Resolve all warnings such as deprecated tcod functions.
    • Frame titles need to be replaced with a custom banner.
  • Add more docstrings to everything. Ideally every module and function would have a docstring.
  • Use better color choices.
  • Organize runtime assets into a data directory.
  • Use the pathlib module for file paths.
  • Apply the refactoring of part 6 and part 8 to the earlier steps of the tutorial.
  • Refactor equipment_types.py.
  • Switch font to a 16x16 font.
  • Use builtin logging module for any logged info, avoid plain print calls.
  • Add error code 0 to all raises of SystemExit. A few minor issues in the new (2020) tutorial. roguelike-tutorials-website#26
  • Fix hard-coded health bar size. A few minor issues in the new (2020) tutorial. roguelike-tutorials-website#26
  • Fix blast radius shape.
@ejfudd
Copy link

ejfudd commented Jun 30, 2021

I submitted PR #50 as a proposal for the blast radius shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants