From 5b54c4fe6aa9f6264fbdb41427edee4ca3c7bf6a Mon Sep 17 00:00:00 2001 From: gptlang <121417512+gptlang@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:24:51 +0000 Subject: [PATCH] fix flake8 issues, duplicate code, and format everything --- .all-contributorsrc | 30 +++++-------------- .luarc.json | 7 ++--- cspell.json | 13 ++------ renovate.json | 4 +-- rplugin/python3/copilot.py | 1 + .../python3/handlers/vsplit_chat_handler.py | 2 +- .../python3/mypynvim/ui_components/popup.py | 2 -- 7 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index cecb0676..0a5effab 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,7 +1,5 @@ { - "files": [ - "README.md" - ], + "files": ["README.md"], "imageSize": 100, "commit": false, "commitType": "docs", @@ -12,56 +10,42 @@ "name": "gptlang", "avatar_url": "https://avatars.githubusercontent.com/u/121417512?v=4", "profile": "https://github.com/gptlang", - "contributions": [ - "code", - "doc" - ] + "contributions": ["code", "doc"] }, { "login": "jellydn", "name": "Dung Duc Huynh (Kaka)", "avatar_url": "https://avatars.githubusercontent.com/u/870029?v=4", "profile": "https://productsway.com/", - "contributions": [ - "code", - "doc" - ] + "contributions": ["code", "doc"] }, { "login": "qoobes", "name": "Ahmed Haracic", "avatar_url": "https://avatars.githubusercontent.com/u/58834655?v=4", "profile": "https://qoobes.dev", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "ziontee113", "name": "Trí Thiện Nguyễn", "avatar_url": "https://avatars.githubusercontent.com/u/102876811?v=4", "profile": "https://youtube.com/@ziontee113", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "Cassius0924", "name": "He Zhizhou", "avatar_url": "https://avatars.githubusercontent.com/u/62874592?v=4", "profile": "https://github.com/Cassius0924", - "contributions": [ - "code" - ] + "contributions": ["code"] }, { "login": "rguruprakash", "name": "Guruprakash Rajakkannu", "avatar_url": "https://avatars.githubusercontent.com/u/9963717?v=4", "profile": "https://www.linkedin.com/in/guruprakashrajakkannu/", - "contributions": [ - "code" - ] + "contributions": ["code"] } ], "contributorsPerLine": 7, diff --git a/.luarc.json b/.luarc.json index d213f255..04ea467f 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,6 +1,3 @@ { - "diagnostics.globals": [ - "describe", - "it" - ] -} \ No newline at end of file + "diagnostics.globals": ["describe", "it"] +} diff --git a/cspell.json b/cspell.json index d7404183..656c8347 100644 --- a/cspell.json +++ b/cspell.json @@ -10,13 +10,6 @@ "addWords": true } ], - "dictionaries": [ - "cspell-tool" - ], - "ignorePaths": [ - "node_modules", - "dist", - "build", - "/cspell-tool.txt" - ] -} \ No newline at end of file + "dictionaries": ["cspell-tool"], + "ignorePaths": ["node_modules", "dist", "build", "/cspell-tool.txt"] +} diff --git a/renovate.json b/renovate.json index 5db72dd6..22a99432 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ] + "extends": ["config:recommended"] } diff --git a/rplugin/python3/copilot.py b/rplugin/python3/copilot.py index c1457e27..ee471b64 100644 --- a/rplugin/python3/copilot.py +++ b/rplugin/python3/copilot.py @@ -5,6 +5,7 @@ from typing import Dict, List import dotenv +import prompts import requests import typings import utilities diff --git a/rplugin/python3/handlers/vsplit_chat_handler.py b/rplugin/python3/handlers/vsplit_chat_handler.py index c4a73736..191fd6b2 100644 --- a/rplugin/python3/handlers/vsplit_chat_handler.py +++ b/rplugin/python3/handlers/vsplit_chat_handler.py @@ -21,7 +21,7 @@ def vsplit(self): if window.vars[var_key]: self.nvim.current.window = window return - except: + except Exception: pass self.buffer.vsplit( diff --git a/rplugin/python3/mypynvim/ui_components/popup.py b/rplugin/python3/mypynvim/ui_components/popup.py index 55b2c782..9040b452 100644 --- a/rplugin/python3/mypynvim/ui_components/popup.py +++ b/rplugin/python3/mypynvim/ui_components/popup.py @@ -9,8 +9,6 @@ from .layout import Layout -if TYPE_CHECKING: - from mypynvim.core.nvim import MyNvim from mypynvim.core.buffer import MyBuffer from mypynvim.core.window import MyWindow