diff --git a/.gitignore b/.gitignore index ac56fbb1b9..544c565bb2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ .coverage .coverage.* .idea -.vscode .project .pydevproject .settings @@ -14,6 +13,9 @@ coverage.xml proxy.py.iml +.vscode/* +!.vscode/settings.json + *.pyc *.egg-info *.csr diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..5ea91a6910 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,31 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": true + }, + "editor.rulers": [100], + "python.testing.unittestEnabled": false, + "python.testing.autoTestDiscoverOnSaveEnabled": true, + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": ["tests"], + "python.linting.enabled": true, + "python.linting.lintOnSave": true, + "python.linting.ignorePatterns": [ + ".tox/**/*.py", + ".vscode/*.py", + ".venv*/**/*.py", + "venv*/**/*.py", + "docs/**/*.py", + "helper/**/*.py", + "menubar/**/*.py" + ], + "python.linting.pylintEnabled": true, + "python.linting.pylintArgs": ["--generate-members"], + "python.linting.flake8Enabled": true, + "python.linting.mypyEnabled": true, + "python.formatting.provider": "autopep8", + "typescript.format.semicolons": "remove", + "typescript.preferences.quoteStyle": "single", + "autoDocstring.docstringFormat": "sphinx" +} diff --git a/proxy/core/base/tcp_upstream.py b/proxy/core/base/tcp_upstream.py index 3f94edc2fe..e04ec5e90d 100644 --- a/proxy/core/base/tcp_upstream.py +++ b/proxy/core/base/tcp_upstream.py @@ -62,7 +62,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: @abstractmethod def handle_upstream_data(self, raw: memoryview) -> None: - pass + raise NotImplementedError() # pragma: no cover def initialize_upstream(self, addr: str, port: int) -> None: self.upstream = TcpServerConnection(addr, port)