jack-mil / bing-rewards

A script to automate daily Bing rewards points
MIT License
199 stars 26 forks source link

`word_generator()` changes #54

Open znarfm opened 1 week ago

znarfm commented 1 week ago

This pull request includes several improvements to the word_generator function in the bing_rewards/__init__.py file. The changes enhance error handling, ensure uniform random distribution, and improve code readability.

Enhancements to word_generator function:

jack-mil commented 1 week ago

Ah, thanks for the contribution. Reading from the file always felt like a bit of a hack to me, and I didn't love my implementation. I will take a look and try this when I have a chance.

If any of the Ruff linting errors seem unreasonable or unnecessary, I am open to disable or ignoring those errors. I kind of went overly zealous when setting up Ruff and configuring errors. Selecting almost everything is probably unnecessary, I was mostly interested in what Ruff would detect.

znarfm commented 1 week ago

Mostly was just errors about using double quotes. Sorry, ruff linting is kinda new for me.

jack-mil commented 1 week ago

you should be able to set up your editor to auto format with Ruff using the project.toml config. Or use the ruff executable directly. Or even use the pre-commit hook. it's up to you