ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Community request] PyLint support - Formatting

Open acheong08 opened this issue 3 years ago • 13 comments

Formatting and consistency is extremely important in large projects. However, as it is currently exam season for me, I don't have enough time to dedicate to this.

If anyone is willing, please format the code so that it passes PyLint. I'm not sure if this can be done automatically.

Sincere thanks

acheong08 avatar Dec 06 '22 10:12 acheong08

@acheong08 Hi I can take this, but I will use black and flake 8 instead of pylint,is that OK?

It can be automatic by pre-commit on every git commit.

vaayne avatar Dec 07 '22 04:12 vaayne

That works as well. Can you also make a pull request for a workflow that checks that instead of PyLint?

acheong08 avatar Dec 07 '22 04:12 acheong08

Sure, I will add a github action for this

vaayne avatar Dec 07 '22 04:12 vaayne

Thank you!

acheong08 avatar Dec 07 '22 04:12 acheong08

Couldn't this be easily done and integrated using something like https://github.com/pre-commit/pre-commit as it is amazing in maintaining consistency as well as you can link flake 8/black/pylint ect

PyRo1121 avatar Dec 07 '22 04:12 PyRo1121

I wasn't aware of this. I will look into it today

acheong08 avatar Dec 07 '22 04:12 acheong08

Couldn't this be easily done and integrated using something like https://github.com/pre-commit/pre-commit as it is amazing in maintaining consistency as well as you can link flake 8/black/pylint ect

Yes, That’s what I’m trying to do.

vaayne avatar Dec 07 '22 04:12 vaayne

Couldn't this be easily done and integrated using something like https://github.com/pre-commit/pre-commit as it is amazing in maintaining consistency as well as you can link flake 8/black/pylint ect

Yes, That’s what I’m trying to do.

Awesome I will work on a version too and see where I can help going forward. I am learning myself and always looking to put in help where I can.

PyRo1121 avatar Dec 07 '22 04:12 PyRo1121

@acheong08 @PyRo1121 I create a PR https://github.com/acheong08/ChatGPT/pull/121 for this, I check the github CI, it all passed. Please review.

vaayne avatar Dec 07 '22 06:12 vaayne

@Vaayne https://github.com/acheong08/ChatGPT/pull/119 Duplicate

acheong08 avatar Dec 07 '22 06:12 acheong08

sure

vaayne avatar Dec 07 '22 06:12 vaayne

@Vaayne You could always pull request to help with args. I put together a default setup for them for now. It will handle keeping the project in a set format plus any linting/debugging you could want with .pre-commit-config.yaml using Pre-commit Hooks. This could use more fine tuning as I learn the code base I will contribute more.

PyRo1121 avatar Dec 07 '22 06:12 PyRo1121

TODO:

setup.py:1:0: C0114: Missing module docstring (missing-module-docstring)
setup.py:18:21: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
************* Module src.revChatGPT
src/revChatGPT/__init__.py:1:0: C0103: Module name "revChatGPT" doesn't conform to snake_case naming style (invalid-name)
************* Module src.revChatGPT.__main__
src/revChatGPT/__main__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
src/revChatGPT/__main__.py:6:0: E0401: Unable to import 'revChatGPT.revChatGPT' (import-error)
src/revChatGPT/__main__.py:[9](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:10):0: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/__main__.py:9:14: W0621: Redefining name 'prompt' from outer scope (line 44) (redefined-outer-name)
src/revChatGPT/__main__.py:41:8: R1722: Consider using sys.exit() (consider-using-sys-exit)
src/revChatGPT/__main__.py:44:8: C0[10](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:11)3: Constant name "prompt" doesn't conform to UPPER_CASE naming style (invalid-name)
src/revChatGPT/__main__.py:46:12: R1724: Unnecessary "elif" after "continue", remove the leading "el" from "elif" (no-else-continue)
src/revChatGPT/__main__.py:78:12: C0103: Constant name "lines_printed" doesn't conform to UPPER_CASE naming style (invalid-name)
src/revChatGPT/__main__.py:96:19: W0703: Catching too general exception Exception (broad-except)
src/revChatGPT/__main__.py:105:19: W0703: Catching too general exception Exception (broad-except)
************* Module src.revChatGPT.revChatGPT
src/revChatGPT/revChatGPT.py:49:0: C0301: Line too long ([11](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:12)7/100) (line-too-long)
src/revChatGPT/revChatGPT.py:219:0: C0301: Line too long (113/100) (line-too-long)
src/revChatGPT/revChatGPT.py:336:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:351:0: C0301: Line too long (107/100) (line-too-long)
src/revChatGPT/revChatGPT.py:359:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:384:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:410:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:433:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:457:0: C0301: Line too long (1[12](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:13)/100) (line-too-long)
src/revChatGPT/revChatGPT.py:463:0: C0301: Line too long (107/100) (line-too-long)
src/revChatGPT/revChatGPT.py:472:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:494:0: C0301: Line too long (110/100) (line-too-long)
src/revChatGPT/revChatGPT.py:500:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:521:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:565:0: C0301: Line too long (117/100) (line-too-long)
src/revChatGPT/revChatGPT.py:1:0: C0114: Missing module docstring (missing-module-docstring)
src/revChatGPT/revChatGPT.py:1:0: C0103: Module name "revChatGPT" doesn't conform to snake_case naming style (invalid-name)
src/revChatGPT/revChatGPT.py:9:0: E0401: Unable to import 'requests' (import-error)
src/revChatGPT/revChatGPT.py:10:0: E0401: Unable to import 'tls_client' (import-error)
src/revChatGPT/revChatGPT.py:[13](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:14):0: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:18:0: C0115: Missing class docstring (missing-class-docstring)
src/revChatGPT/revChatGPT.py:34:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:39:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:60:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:86:12: W0702: No exception type(s) specified (bare-except)
src/revChatGPT/revChatGPT.py:79:16: W0702: No exception type(s) specified (bare-except)
src/revChatGPT/revChatGPT.py:90:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:92:8: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
src/revChatGPT/revChatGPT.py:120:15: W0703: Catching too general exception Exception (broad-except)
src/revChatGPT/revChatGPT.py:[14](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:15)3:12: W0702: No exception type(s) specified (bare-except)
src/revChatGPT/revChatGPT.py:164:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:180:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
src/revChatGPT/revChatGPT.py:187:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:191:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:192:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
src/revChatGPT/revChatGPT.py:204:12: C0103: Variable name "s" doesn't conform to snake_case naming style (invalid-name)
src/revChatGPT/revChatGPT.py:236:19: W0703: Catching too general exception Exception (broad-except)
src/revChatGPT/revChatGPT.py:191:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/revChatGPT/revChatGPT.py:246:4: C0116: Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:287:0: C01[15](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:16): Missing class docstring (missing-class-docstring)
src/revChatGPT/revChatGPT.py:515:4: C01[16](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:17): Missing function or method docstring (missing-function-docstring)
src/revChatGPT/revChatGPT.py:558:4: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 8.11/10

Error: Process completed with exit code [30](https://github.com/acheong08/ChatGPT/actions/runs/3636482712/jobs/6136504202#step:5:31).

acheong08 avatar Dec 07 '22 06:12 acheong08