GhaziDev / Flash-Text-Editor

MIT License
5 stars 1 forks source link

import style #7

Closed Akuli closed 3 years ago

Akuli commented 4 years ago

This project uses lots of from module import *, which is almost always considered bad style in Python. Also, some files import things that they don't use. For example, edit.py imports pyautogui and does nothing with it.

I recommend checking the code with something like flake8. It gives a warning about both of these problems.

GhaziDev commented 4 years ago

thanks for flake8 suggestion, fixed.

Akuli commented 4 years ago

Can you reopen this issue? It doesn't seem to be actually fixed. There are lots of star imports left, and flake8 says that there are also lots of unused imports:

edit.py:1:1: F401 'os' imported but unused
edit.py:2:1: F401 'tkinter.ttk' imported but unused
menubar.py:1:1: F401 'tkinter.ttk' imported but unused
right_click_menu.py:3:1: F401 'keyboard' imported but unused
run.py:1:1: F401 'tkinter.ttk' imported but unused
run.py:2:1: F401 'tkinter.*' imported but unused
run.py:5:1: F401 'tkinter.messagebox' imported but unused
search.py:3:1: F401 'keyboard' imported but unused
theme.py:2:1: F401 'tkinter.ttk' imported but unused
theme.py:5:1: F401 'search.Search' imported but unused
view.py:1:1: F401 'tkinter.ttk' imported but unused
GhaziDev commented 3 years ago

should be fixed from now, expect that flake8 will show warnings about "from tkinter import *", should i re-open the issue then close it?

Akuli commented 3 years ago

Which flake8 version are you using? I just installed the latest flake8 (3.8.4) and I got a lot of warnings.

GhaziDev commented 3 years ago

image should be fixed by now, please test before i close this issue

Akuli commented 3 years ago

Nice. You might want to configure github actions so that it automatically runs flake8 every time you push a commit.