Pokemon-Terminal icon indicating copy to clipboard operation
Pokemon-Terminal copied to clipboard

Simple cleanup

Open ericfrederich opened this issue 5 years ago • 5 comments

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.

ericfrederich avatar May 28 '20 20:05 ericfrederich

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.

ericfrederich avatar May 29 '20 13:05 ericfrederich

Rebased on top of master

ericfrederich avatar Jun 02 '20 20:06 ericfrederich

This sounds pretty good to me, however I'm not sure if the changes pokemonterminal/Data/pokemon.txt won't break anything

sylveon avatar Jun 05 '20 00:06 sylveon

@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

ericfrederich avatar Jun 05 '20 14:06 ericfrederich

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

jimmyorourke avatar Jun 05 '20 14:06 jimmyorourke