kickmaker / kickmaker-chatbot

We built a chatbot based on LLaMA 3 and stable diffusion. You can ask him anything, upload PDF files and question them and even generate images !
1 stars 0 forks source link

Use a formatter and/or linter #3

Open Sylphe88 opened 1 month ago

Sylphe88 commented 1 month ago

Comply with most PEP8 rules using a auto-formatter or linter (flake8, black, pylint...). Can be orchestrated by tox

batoutou commented 1 month ago

@Sylphe88, I'm not sure what is expected here ? an example would be nice to have.

RomainPelletant commented 3 weeks ago

@batoutou PR#7 adds pylint check step as CI PR#9 adds pycodestyle check as CI

pycodestyle could be redundant with pylint checks. If we keep focus on pylint, the following errors appears:

************* Module kickbot.img_gen
kickbot/img_gen.py:13:0: C0301: Line too long (107/100) (line-too-long)
kickbot/img_gen.py:1:0: C0114: Missing module docstring (missing-module-docstring)
kickbot/img_gen.py:5:0: C0115: Missing class docstring (missing-class-docstring)
kickbot/img_gen.py:5:0: C0103: Class name "img_gen" doesn't conform to PascalCase naming style (invalid-name)
kickbot/img_gen.py:9:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/img_gen.py:17:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/img_gen.py:19:8: W0201: Attribute 'image' defined outside __init__ (attribute-defined-outside-init)
************* Module kickbot.kickbot
kickbot/kickbot.py:1:0: C0114: Missing module docstring (missing-module-docstring)
kickbot/kickbot.py:9:0: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/kickbot.py:9:0: R0915: Too many statements (51/50) (too-many-statements)
************* Module kickbot.langChain
kickbot/langChain.py:20:0: C0301: Line too long (230/100) (line-too-long)
kickbot/langChain.py:35:0: C0301: Line too long (181/100) (line-too-long)
kickbot/langChain.py:1:0: C0114: Missing module docstring (missing-module-docstring)
kickbot/langChain.py:1:0: C0103: Module name "langChain" doesn't conform to snake_case naming style (invalid-name)
kickbot/langChain.py:1:0: E0401: Unable to import 'langchain_community.chat_models' (import-error)
kickbot/langChain.py:6:0: C0115: Missing class docstring (missing-class-docstring)
kickbot/langChain.py:6:0: C0103: Class name "langchain" doesn't conform to PascalCase naming style (invalid-name)
kickbot/langChain.py:45:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/langChain.py:57:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/langChain.py:68:15: E0606: Possibly using variable 'prompt' before assignment (possibly-used-before-assignment)
kickbot/langChain.py:71:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/langChain.py:77:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/langChain.py:83:11: R1727: Boolean condition 'query_type == 'text' or 'resume'' will always evaluate to ''resume'' (condition-evals-to-constant)
************* Module kickbot.rag_llm
kickbot/rag_llm.py:95:0: C0301: Line too long (140/100) (line-too-long)
kickbot/rag_llm.py:1:0: C0114: Missing module docstring (missing-module-docstring)
kickbot/rag_llm.py:7:0: E0401: Unable to import 'langchain_community.vectorstores' (import-error)
kickbot/rag_llm.py:8:0: E0401: Unable to import 'langchain_community.embeddings' (import-error)
kickbot/rag_llm.py:9:0: E0401: Unable to import 'langchain_community.document_loaders' (import-error)
kickbot/rag_llm.py:10:0: E0401: Unable to import 'langchain_community.vectorstores.utils' (import-error)
kickbot/rag_llm.py:13:0: C0115: Missing class docstring (missing-class-docstring)
kickbot/rag_llm.py:13:0: C0103: Class name "rag_llm" doesn't conform to PascalCase naming style (invalid-name)
kickbot/rag_llm.py:28:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:47:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:54:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:72:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:81:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:93:12: W0612: Unused variable 'collection' (unused-variable)
kickbot/rag_llm.py:98:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:111:15: E0606: Possibly using variable 'context' before assignment (possibly-used-before-assignment)
kickbot/rag_llm.py:114:4: C0116: Missing function or method docstring (missing-function-docstring)
kickbot/rag_llm.py:29:8: W0201: Attribute 'docs' defined outside __init__ (attribute-defined-outside-init)
kickbot/rag_llm.py:123:12: W0201: Attribute 'docs' defined outside __init__ (attribute-defined-outside-init)
************* Module setup
setup.py:1:0: C0114: Missing module docstring (missing-module-docstring)

Please note that "line too long" errors have been solved in PR#9 based on <79 characters/line