fossasia / susi_linux

Hardware for SUSI AI https://susi.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clean code to match Python coding style

hongquan opened this issue · comments

Describe the bug

Currently, many parts of our code don't follow Python coding style. Now, please clean it.
Please also group and arrange the import lines.

Objective

  • Follow PEP8 as much as possible. For line length, it can be 120 chars (PEP8 suggests 79, but I think that number is only relevant for old display device, while all of us now use wide screen monitor).
  • Don't leave unused "import", unused variable. This can be detected with pyflakes tool.

Tools

This work doesn't need much brain. So we should leave it for tools. I recommend pycodestyle, pyflakes. They help you find problematic lines, but not fix for you. Other than that, please install appropriate plugins to your code editor to integrate the tools.

This is how you can do in VS Code:

  • Install Python extension.
  • Add this to settings:
{
    "python.linting.flake8Enabled": true,
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true
}

May i work on this issue?

@bhadreshpsavani sure enough, go ahead and send PR

it's been a while, @norbusan @stealthanthrax May I work on this ?

Everyone can work on that, just do it and send PRs...