Skip to content

apply ruff #496

@phi-friday

Description

@phi-friday

Is your feature request related to a problem? Please describe.
For now, the quality of the code in this library is up to the contributors.
This has resulted in each piece of code having an inconsistent style,
sometimes resulting in performance-impacting patterns.

Several libraries have been developed to fix this problem,
and I've seen some of them being used in CI.(pydocstyle)

Describe the solution you'd like
There are so many libraries to fix this problem that it was difficult to decide on a specific one.
However, since the release of ruff, many major libraries have decided to use it.
(pandas, matplotlib, scipy, sklearn, ...)

This is because it implies many rules that are supported by other libraries,
(black, isort, pydocstyle, flake, ...)
and it works the fastest.

It's also not hard to use.
Just write your code as before, and run ruff format bayes_opt && ruff check bayes_opt.
If you use pre-commit, it's even simpler.

It can be a little difficult to set up the ruff rules you want to use, while maintaining existing code style.
However, if you spend a little time on the initial setup, it's simple from there.

References or alternative approaches
If this feature was described in literature, please add references here. Additionally, feel free to add descriptions of any alternative solutions or features you've considered.

Additional context
https://github.com/astral-sh/ruff
playground

Are you able and willing to implement this feature yourself and open a pull request?

  • Yes, I can provide this feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions