patchback[bot]
b769b0bc01
[PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix ( #11409 )
...
Sort imports with ruff check --fix (#11400 )
Sort imports with ruff check --fix.
(cherry picked from commit 236b9c0e04 )
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-09 19:36:52 +01:00
patchback[bot]
303bac630a
[PR #11342/266d9d3f backport][stable-12] batch 2 - update Python idiom to 3.7 using pyupgrade ( #11345 )
...
batch 2 - update Python idiom to 3.7 using pyupgrade (#11342 )
* batch 2 - update Python idiom to 3.7 using pyupgrade
* Apply suggestions from code review
(cherry picked from commit 266d9d3fb0 )
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-30 16:00:22 +01:00
patchback[bot]
8cd80d94a0
[PR #11049/396f467b backport][stable-12] Improve Python code: address unused variables ( #11058 )
...
Improve Python code: address unused variables (#11049 )
* Address F841 (unused variable).
* Reformat.
* Add changelog fragment.
* More cleanup.
* Remove trailing whitespace.
* Readd removed code as a comment with TODO.
(cherry picked from commit 396f467bbb )
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-09 09:59:42 +01:00
patchback[bot]
16f1d07509
[PR #11043/3478863e backport][stable-12] Address issues reported by ruff check ( #11047 )
...
Address issues reported by ruff check (#11043 )
* Resolve E713 and E714 (not in/is tests).
* Address UP018 (unnecessary str call).
* UP045 requires Python 3.10+.
* Address UP007 (X | Y for type annotations).
* Address UP035 (import Callable from collections.abc).
* Address UP006 (t.Dict -> dict).
* Address UP009 (UTF-8 encoding comment).
* Address UP034 (extraneous parantheses).
* Address SIM910 (dict.get() with None default).
* Address F401 (unused import).
* Address UP020 (use builtin open).
* Address B009 and B010 (getattr/setattr with constant name).
* Address SIM300 (Yoda conditions).
* UP029 isn't in use anyway.
* Address FLY002 (static join).
* Address B034 (re.sub positional args).
* Address B020 (loop variable overrides input).
* Address B017 (assert raise Exception).
* Address SIM211 (if expression with false/true).
* Address SIM113 (enumerate for loop).
* Address UP036 (sys.version_info checks).
* Remove unnecessary UP039.
* Address SIM201 (not ==).
* Address SIM212 (if expr with twisted arms).
* Add changelog fragment.
* Reformat.
(cherry picked from commit 3478863ef0 )
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-08 09:49:52 +01:00
Felix Fontein
340ff8586d
Reformat everything.
2025-11-01 13:46:53 +01:00
Felix Fontein
6088b0cff5
CI: add type checking ( #10997 )
...
* Set up type checking with mypy.
* Make mypy pass.
* Use list() instead of sorted().
2025-10-29 17:13:38 +00:00
Alexei Znamensky
e177d1e61a
unit tests (modules): use f-strings ( #10992 )
...
* unit tests (modules): use f-strings
* Apply suggestions from code review
2025-10-27 11:08:33 +13:00
Felix Fontein
74b6a0294a
Unit tests: clean up compat imports ( #10902 )
...
Clean up compat imports.
2025-10-11 10:03:37 +02:00
Felix Fontein
8f8a0e1d7c
Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files ( #10886 )
...
* Adjust all __future__ imports:
for i in $(grep -REl "__future__.*absolute_import" plugins/ tests/); do
sed -e 's/from __future__ import .*/from __future__ import annotations/g' -i $i;
done
* Remove all UTF-8 encoding specifications for Python source files:
for i in $(grep -REl '[-][*]- coding: utf-8 -[*]-' plugins/ tests/); do
sed -e '/^# -\*- coding: utf-8 -\*-/d' -i $i;
done
* Remove __metaclass__ = type:
for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
sed -e '/^__metaclass__ = type/d' -i $i;
done
2025-10-10 19:52:04 +02:00
Felix Fontein
410cf72aec
Unit tests: replace mock and compat with code from community.internal_test_tools ( #9921 )
...
* Replace compat with equivalent from community.internal_test_tools.
* Replace mock with equivalent from community.internal_test_tools.
2025-03-22 14:12:56 +01:00
Roman Belyakovsky
abcba9dbbe
Interfaces file spaces fix ( #6131 )
...
* interfaces_file: added test case for #6120
* interfaces_file: reverted code to #fafabed
* interfaces_file: added changelog fragment
* interfaces_file: added missing licenses
* interfaces_file: improved test coverage
* interfaces_file: fixed retrieving option values
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update tests/unit/plugins/modules/interfaces_file/test_interfaces_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* interfaces_file: spacing fix
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-09 20:09:13 +01:00
Felix Fontein
b531ecdc9b
Unflatmap community.general ( #5461 )
...
* Move files.
* Update imports and references.
* Move wrongly placed files.
* Reverse redirects, deprecate long → short name redirects.
* Simplify contribution guidelines for new modules.
* Rewrite BOTMETA.
* Add changelog fragment.
* Fix ignore.txt files.
2022-11-02 20:42:29 +00:00