Project-Platypus / Platypus

A Free and Open Source Python Library for Multiobjective Optimization
GNU General Public License v3.0
573 stars 152 forks source link

Cleanup codebase using ruff #230

Closed EwoutH closed 3 months ago

EwoutH commented 3 months ago

Ran ruff v0.6.1. It fixed a lot of unused imports, and a few other syntax things.

dhadka commented 3 months ago

😄 I've been addressing flake8 issues which overlaps with a lot of these. I'll get this and my flake8 changes de-conflicted - https://github.com/Project-Platypus/Platypus/pull/229.

EwoutH commented 3 months ago

Go ahead with flake first, I will rebase afterwards.

To fully make ruff happy, it wants all star imports (like from platypus import *) replaced with regular, explicit imports. That might be quite a large undertaking if we want to do that.

dhadka commented 3 months ago

Yeah, flake8 is also flagging the star imports. I've put it as a TODO along with some other code formatting issues:

        # Ignore existing issues, but we should eventually fix these...
        #    E127 - Continuation line over-indented for visual indent
        #    E128 - Continuation line under-indented for visual indent
        #    E129 - Visually indented line with same indent as next logical line
        #    E201 - Whitespace after '('
        #    E202 - Whitespace before ')'
        #    E203 - Whitespace before ':'
        #    E225 - Missing whitespace around operator
        #    E251 - Unexpected spaces around keyword / parameter equals
        #    E302 - Expected 2 blank lines, found N
        #    E501 - Line too long (N > 79 characters)
        #    E741 - Do not use variables named 'I', 'O', or 'l'
        #    F401 - Module imported but unused
        #    F403 - 'from module import *' used; unable to detect undefined names
        #    F405 - Name may be undefined, or defined from star imports: module
        flake8 --extend-ignore=E127,E128,E129,E201,E202,E203,E225,E251,E302,E501,E741,F403,F405 --per-file-ignores="__init__.py:F401" platypus/