Pokemon-Terminal
Pokemon-Terminal copied to clipboard
Simple cleanup
Hi, neat project. I'd like to contribute some features... but first, can we clean up this code?
There's a lot of changes to look through. There are no trojan-horses in this commit. I simply ran black on this repo. In fact you can reproduce it yourself.
git clone https://github.com/LazoCoder/Pokemon-Terminal.git
cd Pokemon-Terminal/
git remote add eric https://github.com/ericfrederich/Pokemon-Terminal.git
git fetch --all
# create new verification branch
git checkout -b verify origin/master
# see tons of changes
git diff --stat eric/cleanup
# grab pre-commit configuration file from the cleanup branch
git show eric/cleanup:.pre-commit-config.yaml > .pre-commit-config.yaml
# run pre-commit
pre-commit run -a
# no difference now
git diff --stat eric/cleanup
These changes do nothing if you don't have pre-commit installed or have it installed but not enabled on your local repo, so it doesn't force this on anyone.
Personally I'm not the biggest fan of some of the ways that black formats things
I agree but I've come to accept it. When it becomes automatic via pre-commit then I don't even think about it much anymore.
Rebased on top of master
This sounds pretty good to me, however I'm not sure if the changes pokemonterminal/Data/pokemon.txt won't break anything
@sylveon let me ease your concerns.
- I've been using my copy of this code without issue. Installed via
pipx install -e .while in my Git repo. - Doing a side-by-side diff on the .txt file shows only trailing whitespace was stripped. This was already being done by the python code
pkmn_data = line.strip().split()seen here
I say if it works 🚢 it!
But if somehow the trailing whitespace removal from pokemon.txt does cause problems then we really shouldn't be using a txt file, and should be using something standard like csv or json instead