Crackerjack code formatting style.
Project description
Crackerjack Python
Crackerjack is a python coding, formatting, and documentation style for statically typed python >=3.10
Why Crackerjack?
Crackerjack exists to make modern python code more elegant and readable. Let's face it, the python documentation system has been a major contributor to the languages popularity, but over time python code in packages and repositories has become so cluttered up with docstrings, doctests, and comments that it actually becomes really hard to find the actual code in it - nonetheless read through it. Yes, modern IDE's offer up options to fold the docstrings, but this doesn't help when looking through code on GitHub, or in an console based editor like vi and doesn't account for either for all the different ways that developers comment up their code. There must be some sanity!
Enter Crackerjack. Crackerjack works on the theory that with statically typed python code and explicit class, function, variable, and other object names the code should be straight forward to read and the documentation should pretty much be able to write itself (can you say ai). Crackerjack also has coding style guidelines that exist to keep the codebase clean, elegant, standardized, and easily readable - give it to me straight basically.
What does this package do?
Crackjack first cleans up the codebase by removing all docstrings and comments that do not conform to Crackerjack standards (see below). The code is then reformatted to the Black code style, unused imports are removed with autoflake, and remaining imports sorted by reorder_python_imports. After that MonkeyType is run to add type annotations to the code and optionally run through Mypy to check for errors.
What are the rules?
(...more what you'd call "guidelines" than actual rules. -Captain Barbossa )
-
All docstrings, README's, and other documentation is to be done in Markdown (md)
-
Code needs to be black'ed
-
Imports are one single import per line (see reorder_python_imports) - this not only helps aviod merge conflicts but makes it easier to manipulate if using hot-keys
-
Use pathlib.Path not os.path
-
If a function or class is performing file operations it should be passed a Path object - not a string
-
Work in progress
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file crackerjack-0.1.0.tar.gz
.
File metadata
- Download URL: crackerjack-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.4.7 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a501d824f408214f1a2e3f02b7e1d597da318b835ed727eed3d1f9a82c6bb5b2 |
|
MD5 | 56aa0df0e8cd9496dcf986c3932d57d8 |
|
BLAKE2b-256 | c3755fe90bfe231b312afff0926bfdde39c5528e6cfc1dd4220069c4fd5b8900 |
File details
Details for the file crackerjack-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: crackerjack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.4.7 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec82942a6923f09add7b3b4cd5caec2ac2389565d2d5e1b13376b2ed2611381d |
|
MD5 | e1827f0641618f4896d1c5bd558dcfd0 |
|
BLAKE2b-256 | a4f61abe89f689196a6bd1a0f43fc8ade5f293496764abb1101aa1d2c2dac627 |