diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-01-03 12:02:39 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-01-03 13:36:14 +0100 |
commit | f2d8ea38eef4e9d382bf14831c05c06cde478807 (patch) | |
tree | 9eca2a01047c669f44ab2184762453f9fc5c9d2b | |
parent | Update Python virtual environment (diff) | |
download | rtems-central-f2d8ea38eef4e9d382bf14831c05c06cde478807.tar.bz2 |
pylint: Disable no-self-use
This check is optional in version 2.14.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | rtemsspec/content.py | 4 | ||||
-rw-r--r-- | rtemsspec/interface.py | 2 | ||||
-rw-r--r-- | rtemsspec/items.py | 4 | ||||
-rw-r--r-- | rtemsspec/specdoc.py | 1 | ||||
-rwxr-xr-x | rtemsspec/specverify.py | 4 |
6 files changed, 1 insertions, 16 deletions
@@ -12,7 +12,7 @@ format: $(PY_ALL_FILES) | check-env analyse: $(PY_SRC_FILES) | check-env flake8 $^ mypy $^ - pylint $^ + pylint --disable=no-self-use $^ check-env: test -n "$$VIRTUAL_ENV" diff --git a/rtemsspec/content.py b/rtemsspec/content.py index c76d33d0..493c963c 100644 --- a/rtemsspec/content.py +++ b/rtemsspec/content.py @@ -1077,12 +1077,10 @@ def get_value_compound(ctx: ItemGetValueContext) -> Any: class ExpressionMapper: """ Maps symbols and operations to form a C expression. """ - # pylint: disable=no-self-use def map_bool(self, value: bool) -> str: """ Maps a boolean value to build an expression. """ return str(int(value)) - # pylint: disable=no-self-use def map_symbol(self, symbol: str) -> str: """ Maps a symbol to build an expression. """ if symbol.startswith("CPU_"): @@ -1105,11 +1103,9 @@ class ExpressionMapper: class PythonExpressionMapper(ExpressionMapper): """ Maps symbols and operations to form a Python expression. """ - # pylint: disable=no-self-use def map_bool(self, value: bool) -> str: return str(value) - # pylint: disable=no-self-use def map_symbol(self, symbol: str) -> str: return symbol diff --git a/rtemsspec/interface.py b/rtemsspec/interface.py index 1162f81c..5a45d6f3 100644 --- a/rtemsspec/interface.py +++ b/rtemsspec/interface.py @@ -594,7 +594,6 @@ class Node: def _get_register_define_definition(self, item: Item, definition: Any, ctx: _RegisterMemberContext, offset: int) -> Lines: - # pylint: disable=no-self-use name, alias = _get_register_name(definition) count = definition["count"] assert count == 1 @@ -607,7 +606,6 @@ class Node: def _get_register_member_definition(self, _item: Item, definition: Any, ctx: _RegisterMemberContext) -> Lines: - # pylint: disable=no-self-use name, alias = _get_register_name(definition) count = definition["count"] array = f"[ {count} ]" if count > 1 else "" diff --git a/rtemsspec/items.py b/rtemsspec/items.py index 2120a9ed..b6278e8a 100644 --- a/rtemsspec/items.py +++ b/rtemsspec/items.py @@ -778,11 +778,9 @@ class ItemCache: def load_data(self, path: str, uid: str) -> Any: """ Loads the item data from the file specified by path. """ - # pylint: disable=no-self-use return _load_yaml_data(path, uid) def _save_data(self, file: TextIO, data: Any) -> None: - # pylint: disable=no-self-use file.write( yaml.dump(data, default_flow_style=False, allow_unicode=True)) @@ -845,11 +843,9 @@ class JSONItemCache(ItemCache): self._load_json_items(path, path) def load_data(self, path: str, uid: str) -> Any: - # pylint: disable=no-self-use return _load_json_data(path, uid) def _save_data(self, file: TextIO, data: Any) -> None: - # pylint: disable=no-self-use json.dump(data, file, sort_keys=True, indent=2) diff --git a/rtemsspec/specdoc.py b/rtemsspec/specdoc.py index 59f34d9e..ee1f3090 100644 --- a/rtemsspec/specdoc.py +++ b/rtemsspec/specdoc.py @@ -413,7 +413,6 @@ class _Documenter: def document_none(self, content: SphinxContent, _variant: str, shall: str, _info: Any) -> None: """ Documents a none value. """ - # pylint: disable=no-self-use content.paste(f"There {shall} be no value (null).") def _add_description(self, content: SphinxContent) -> None: diff --git a/rtemsspec/specverify.py b/rtemsspec/specverify.py index 0cf05c3c..50c576d8 100755 --- a/rtemsspec/specverify.py +++ b/rtemsspec/specverify.py @@ -287,7 +287,6 @@ class _ItemVerifier(_Verifier): def verify_bool(self, path: _Path, value: Any, type_info: Any) -> Set[str]: """ Verifies a boolean value. """ - # pylint: disable=no-self-use if type_info and "assert" in type_info: expected = type_info["assert"] if expected != value: @@ -402,7 +401,6 @@ class _ItemVerifier(_Verifier): def verify_int_or_float(self, path: _Path, value: Any, type_info: Any) -> Set[str]: """ Verifies an integer or float value. """ - # pylint: disable=no-self-use if not _assert_int_or_float(path, value, type_info): logging.error("%s invalid value: %s", _prefix(path), str(value)) return set() @@ -418,12 +416,10 @@ class _ItemVerifier(_Verifier): def verify_none(self, _path: _Path, _value: Any, _type_info: Any) -> Set[str]: """ Verifies a none value. """ - # pylint: disable=no-self-use return set() def verify_str(self, path: _Path, value: Any, type_info: Any) -> Set[str]: """ Verifies a string value. """ - # pylint: disable=no-self-use if not _assert_str(path, value, type_info): logging.error("%s invalid value: %s", _prefix(path), value) return set() |