Skip to content

Commit

Permalink
Ignore pylint errors in opendal imports only
Browse files Browse the repository at this point in the history
- Make pylint ignore `import-error,no-name-in-module` only in files imported into opendal and not globally
  • Loading branch information
pk5ls20 committed Feb 12, 2024
1 parent b8940b1 commit 367e595
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 4 additions & 1 deletion app/Services/storage/s3_compatible_storage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# pylint now reporting `opendal` as a `no-name-in-module` error, so we need to disable it as a temporary workaround
# Related issue: https://github.com/pylint-dev/pylint/issues/9185
# Remove below `# pylint` once the issue is resolved
# pylint: disable=import-error,no-name-in-module
import os
import urllib.parse

Expand Down Expand Up @@ -45,7 +49,6 @@ def __init__(self):
self._res_endpoint = self._resolve_endpoint()
self._access_key_id = config.storage.s3.access_key_id
self._secret_access_key = config.storage.s3.secret_access_key
self.file_path_warp = lambda x: PurePosixPath(x)
self.file_path_str_warp = lambda x: str(PurePosixPath(x))
self.op = AsyncOperator("s3",
root=str(self.static_dir),
Expand Down
7 changes: 1 addition & 6 deletions pylintrc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,7 @@ confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFIN
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".

# pylint now reporting `opendal` as a `no-name-in-module` error, so we need to disable it as a temporary workaround
# Related issue: https://github.com/pylint-dev/pylint/issues/9185
# Remove `no-name-in-module` and `import-error` once the issue is resolved

disable = ["no-name-in-module", "import-error", "raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "missing-function-docstring", "missing-class-docstring", "missing-module-docstring"]
disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "missing-function-docstring", "missing-class-docstring", "missing-module-docstring"]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down

0 comments on commit 367e595

Please sign in to comment.