danparizher / Pax-Academia

General purpose utility bot for the Homework Help Discord server
MIT License
13 stars 5 forks source link

refactor(part 1): utils #228

Closed GabeMillikan closed 1 year ago

GabeMillikan commented 1 year ago

I highly recommend looking through each commit individually, it will be much easier to review.

The util/ folder has become very cluttered, it's just a place where we put anything that's not a cog. This is ugly!

This PR re-organizes the directory from the current layout:

Pax-Academia/
└── util/
    ├── code_detection/
    │   └── ...
    ├── database.sqlite
    ├── db_builder.py
    ├── db_update.py
    ├── dev.py
    ├── embed_builder.py
    ├── ERD.mdj
    ├── Logging.py
    └── README.md

to a new, well-organized layout:

Pax-Academia/
├── code_detection/
│   └── ...
├── database/
│   ├── __init__.py
│   ├── database.sqlite
│   ├── schema.py # formerly: "db_builder.py"
│   ├── migrate.py # formerly: "db_update.py"
│   └── ERD.mdj
├── message_formatting/
│   ├── views/
│   │   └── dev.py # will be renamed to `feedback.py` once development is complete
│   └── embeds.py # formerly: "embed_builder.py"
└── util/
    ├── logger.py # formerly: "Logging.py"
    └── limiter.py # a new home for `@limit`

I also added a new database/README.md that explains how our database works. I also removed log.txt from /view-database because

  1. that didn't make any sense anyway, it's not a database
  2. it makes the code (and typing) unnecessarily complex
  3. you can easily view that file via /view-logs

This PR is the precursor to https://github.com/Arborym/Pax-Academia/pull/229.

sebastiaan-daniels commented 1 year ago

See comments in discord