• 0 Posts
  • 5 Comments
Joined 1 year ago
cake
Cake day: October 24th, 2023

help-circle
  • “Clean code” is always about preference. I like code I can read and understand. If I want extra comments or keep some commented code to make a thought process about a coding decision more clear then that’s not a bad thing, IMHO.

    And if print() is such a bad thing, why wasn’t it deprecated for Python 3? Again this probably just comes down to preference again. I just print a final result of a program to stdout (which can be binary data, or some SVG, or just some lines of information). That has nothing to do with “logging”, IMHO.

    I don’t know who Uncle Bob is. 😳




  • I only experimented with it briefly (the old version and the new version I downloaded today). I don’t remember configuring anything, so I assume it runs like that by default:

    $ ruff config
    allowed-confusables
    builtins
    cache-dir
    dummy-variable-rgx
    exclude
    extend
    extend-exclude
    extend-ignore
    extend-select
    external
    fix
    fix-only
    fixable
    format
    force-exclude
    ignore
    ignore-init-module-imports
    line-length
    required-version
    respect-gitignore
    select
    show-source
    show-fixes
    src
    namespace-packages
    target-version
    task-tags
    typing-modules
    unfixable
    update-check
    flake8-annotations
    flake8-bandit
    flake8-bugbear
    flake8-builtins
    flake8-comprehensions
    flake8-errmsg
    flake8-quotes
    flake8-self
    flake8-tidy-imports
    flake8-type-checking
    flake8-gettext
    flake8-implicit-str-concat
    flake8-import-conventions
    flake8-pytest-style
    flake8-unused-arguments
    isort
    mccabe
    pep8-naming
    pycodestyle
    pydocstyle
    pylint
    pyupgrade
    per-file-ignores
    

    Certainly this will become more useful toned down to sane limits, but it needs time/ research/ reading lots of documentation(?) to sort that out. A more sane default would be nice, IMHO.


  • I have to admit… compared to some older ruff I had on disk it now reports like double of “errors”. 99% of them irrelevant to actual issues. It’s over reporting silly things so much it has become useless to use. It may or may not report something critical between all the noise, but it’s hard to see the tree because of the forest, so to speak.

    I guess this is that new “black” stuff?


    If I was to make my code compatible to what it wants I couldn’t use/read it anymore. :) Probably my programs would stop working too:

    T201 `print` found
    

    I guess I have to comment that out.

    ERA001 Found commented-out code
    

    Oups. I guess I just rm *.py to fix the madness. 😎