Open znarfm opened 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.
Mostly was just errors about using double quotes. Sorry, ruff linting is kinda new for me.
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
This pull request includes several improvements to the
word_generator
function in thebing_rewards/__init__.py
file. The changes enhance error handling, ensure uniform random distribution, and improve code readability.Enhancements to
word_generator
function:Generator[str, None, None]
.FileNotFoundError
andIOError
, with appropriate error messages and re-raising of exceptions.ValueError
if the file size is zero. (Useful when implementing a feature to add your own .txt files for searches)