-
Notifications
You must be signed in to change notification settings - Fork 363
refactor(ruff): remove ruff per file exemptions (#2120) #2139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5a7212c
636fb4e
21149b6
5f8d441
6e8a887
bbe1360
9daff76
5fc63cc
2805862
508ebd3
f5525ca
ff9215d
1706398
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,6 @@ | |
| import venv | ||
| except ImportError: | ||
| USE_VIRTUALENV = True | ||
| import virtualenv | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we keep this just to make sure that there's an import failure if it's not installed? |
||
|
|
||
|
|
||
| source_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
|
@@ -29,7 +28,7 @@ | |
| # though rez is not yet built. | ||
| # | ||
| from rez.utils._version import _rez_version # noqa: E402 | ||
| from rez.utils.filesystem import safe_rmtree | ||
| from rez.utils.filesystem import safe_rmtree # noqa: E402 | ||
| from rez.utils.which import which # noqa: E402 | ||
| from rez.cli._entry_points import get_specifications # noqa: E402 | ||
| from rez.vendor.distlib.scripts import ScriptMaker # noqa: E402 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,12 +21,12 @@ | |
|
|
||
|
|
||
| def commands() -> None: | ||
| env.PYTHONPATH.append('{this.root}/python') | ||
| env.PYTHONPATH.append('{this.root}/python') # noqa: F821 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer if we use qualified names instead of IDs. |
||
|
|
||
|
|
||
| def commands_with_bin() -> None: | ||
| env.PYTHONPATH.append('{this.root}/python') | ||
| env.PATH.append('{this.root}/bin') | ||
| env.PYTHONPATH.append('{this.root}/python') # noqa: F821 | ||
| env.PATH.append('{this.root}/bin') # noqa: F821 | ||
|
|
||
|
|
||
| def copy_module(name, destpath): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,7 +193,9 @@ def __str__(self) -> str: | |
| raise NotImplementedError | ||
|
|
||
| def __eq__(self, other): | ||
| return type(self) == type(other) and str(self) == str(other) # noqa: E721 | ||
| if isinstance(other, type(self)): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we 100% sure that this will not create a problem? This is different than |
||
| return str(self) == str(other) | ||
| return NotImplemented | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why return NotImplemented here and not in other classes? |
||
|
|
||
| def __ne__(self, other) -> bool: | ||
| return not self == other | ||
|
|
@@ -220,7 +222,7 @@ def __str__(self) -> str: | |
| return "{}" | ||
|
|
||
| def __eq__(self, other): | ||
| return type(self) == type(other) # noqa: E721 | ||
| return type(self) is type(other) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we use |
||
|
|
||
| def to_pod(self) -> dict[str, Any]: | ||
| """ | ||
|
|
@@ -266,10 +268,7 @@ def __str__(self) -> str: | |
| return str(self.descending) | ||
|
|
||
| def __eq__(self, other): | ||
| return ( # noqa: E721 | ||
| type(self) == type(other) | ||
| and self.descending == other.descending | ||
| ) | ||
| return type(self) is type(other) and self.descending == other.descending | ||
|
|
||
| def to_pod(self) -> dict[str, Any]: | ||
| """ | ||
|
|
@@ -345,8 +344,8 @@ def __str__(self) -> str: | |
| return str((items, str(self.default_order))) | ||
|
|
||
| def __eq__(self, other): | ||
| return ( # noqa: E721 | ||
| type(other) == type(self) | ||
| return ( | ||
| type(other) is type(self) | ||
| and self.order_dict == other.order_dict | ||
| and self.default_order == other.default_order | ||
| ) | ||
|
|
@@ -437,10 +436,7 @@ def __str__(self) -> str: | |
| return str(self.first_version) | ||
|
|
||
| def __eq__(self, other): | ||
| return ( # noqa: E721 | ||
| type(other) == type(self) | ||
| and self.first_version == other.first_version | ||
| ) | ||
| return type(other) is type(self) and self.first_version == other.first_version | ||
|
|
||
| def to_pod(self) -> dict[str, Any]: | ||
| """ | ||
|
|
@@ -601,7 +597,7 @@ def __str__(self) -> str: | |
|
|
||
| def __eq__(self, other): | ||
| return ( # noqa: E721 | ||
| type(other) == type(self) | ||
| type(other) is type(self) | ||
| and self.timestamp == other.timestamp | ||
| and self.rank == other.rank | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| extend = "../../../ruff.toml" | ||
|
|
||
| # Treat rex as builtin | ||
| builtins = [ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels "risky" to me. Can we instead use https://github.com/AcademySoftwareFoundation/rez/blob/main/src/rez/utils/lint_helper.py where these are referenced? |
||
| "alias", | ||
| "appendenv", | ||
| "command", | ||
| "comment", | ||
| "defined", | ||
| "env", | ||
| "error", | ||
| "getenv", | ||
| "info", | ||
| "prependenv", | ||
| "setenv", | ||
| "shebang", | ||
| "source", | ||
| "undefined", | ||
| "unsetenv", | ||
| ] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, support is something we would want to lint eventually...