troubadix 25.3.2__py3-none-any.whl → 25.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- troubadix/__version__.py +1 -1
- troubadix/plugins/__init__.py +42 -0
- {troubadix-25.3.2.dist-info → troubadix-25.3.3.dist-info}/METADATA +1 -1
- {troubadix-25.3.2.dist-info → troubadix-25.3.3.dist-info}/RECORD +7 -7
- {troubadix-25.3.2.dist-info → troubadix-25.3.3.dist-info}/LICENSE +0 -0
- {troubadix-25.3.2.dist-info → troubadix-25.3.3.dist-info}/WHEEL +0 -0
- {troubadix-25.3.2.dist-info → troubadix-25.3.3.dist-info}/entry_points.txt +0 -0
troubadix/__version__.py
CHANGED
troubadix/plugins/__init__.py
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
|
+
import difflib
|
|
18
19
|
from typing import Iterable, List
|
|
19
20
|
|
|
20
21
|
from troubadix.plugin import FilePlugin, FilesPlugin, Plugin
|
|
@@ -175,13 +176,22 @@ class StandardPlugins(Plugins):
|
|
|
175
176
|
) -> None:
|
|
176
177
|
file_plugins = _FILE_PLUGINS
|
|
177
178
|
files_plugins = _FILES_PLUGINS
|
|
179
|
+
|
|
178
180
|
if excluded_plugins:
|
|
181
|
+
self._check_unknown_plugins(
|
|
182
|
+
_FILE_PLUGINS + _FILES_PLUGINS, excluded_plugins
|
|
183
|
+
)
|
|
184
|
+
|
|
179
185
|
file_plugins = self._exclude_plugins(excluded_plugins, file_plugins)
|
|
180
186
|
files_plugins = self._exclude_plugins(
|
|
181
187
|
excluded_plugins, files_plugins
|
|
182
188
|
)
|
|
183
189
|
|
|
184
190
|
if included_plugins:
|
|
191
|
+
self._check_unknown_plugins(
|
|
192
|
+
_FILE_PLUGINS + _FILES_PLUGINS, included_plugins
|
|
193
|
+
)
|
|
194
|
+
|
|
185
195
|
file_plugins = self._include_plugins(included_plugins, file_plugins)
|
|
186
196
|
files_plugins = self._include_plugins(
|
|
187
197
|
included_plugins, files_plugins
|
|
@@ -208,3 +218,35 @@ class StandardPlugins(Plugins):
|
|
|
208
218
|
for plugin in plugins
|
|
209
219
|
if plugin.__name__ in included or plugin.name in included
|
|
210
220
|
]
|
|
221
|
+
|
|
222
|
+
@staticmethod
|
|
223
|
+
def _check_unknown_plugins(found_plugins, selected_plugins):
|
|
224
|
+
if len(found_plugins) == len(selected_plugins):
|
|
225
|
+
return
|
|
226
|
+
|
|
227
|
+
all_plugin_names = {
|
|
228
|
+
name
|
|
229
|
+
for plugin in _FILE_PLUGINS + _FILES_PLUGINS
|
|
230
|
+
for name in (plugin.name, plugin.__name__)
|
|
231
|
+
}
|
|
232
|
+
found_plugin_names = {
|
|
233
|
+
name
|
|
234
|
+
for plugin in found_plugins
|
|
235
|
+
for name in (plugin.name, plugin.__name__)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
unknown_plugins = set(selected_plugins).difference(found_plugin_names)
|
|
239
|
+
|
|
240
|
+
if not unknown_plugins:
|
|
241
|
+
return
|
|
242
|
+
|
|
243
|
+
messages = []
|
|
244
|
+
for plugin in sorted(unknown_plugins):
|
|
245
|
+
message = f"'{plugin}'"
|
|
246
|
+
match = difflib.get_close_matches(plugin, all_plugin_names, n=1)
|
|
247
|
+
if match:
|
|
248
|
+
message += f" (Did you mean '{match[0]}'?)"
|
|
249
|
+
|
|
250
|
+
messages.append(message)
|
|
251
|
+
|
|
252
|
+
raise ValueError(f"Unknown plugins: {', '.join(messages)}")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
troubadix/__init__.py,sha256=K7sIXXDrC7YRb7BvIpdQ6ZfG_QkT0qUH_wAlHROVRfM,716
|
|
2
|
-
troubadix/__version__.py,sha256=
|
|
2
|
+
troubadix/__version__.py,sha256=q5kWKpRVFYVkKWYs2N4F77Md7amqbRNf6_bct4WFtMA,103
|
|
3
3
|
troubadix/argparser.py,sha256=-H07Jhqh68_M4Mbjq9qJjTr3MShy_N2pxl2qHA6cfRU,7481
|
|
4
4
|
troubadix/codespell/codespell.additions,sha256=NAYnQF79kdk4YhU_h8fpjAVVkqBm778aPHPPP7FEkZY,504
|
|
5
5
|
troubadix/codespell/codespell.exclude,sha256=RS0PH7Px2NRg40UpreuXfnInaC4veaeeDxP1FNac4ms,147431
|
|
@@ -9,7 +9,7 @@ troubadix/helper/helper.py,sha256=GXapYLii2rLKwkX2ok31YoAdUSizBnyPjWz-aPP6HM8,31
|
|
|
9
9
|
troubadix/helper/linguistic_exception_handler.py,sha256=Bq7ULjDdWTKUpFNTUX6XMPdD4s4v8eIjZPyqBe8VLws,6811
|
|
10
10
|
troubadix/helper/patterns.py,sha256=_ifRnwHsPee9B0yRYSCsyFms4StWVWJq7I9YnQwToa8,9174
|
|
11
11
|
troubadix/plugin.py,sha256=3fQPj3Qe_hgwHerlYE4hbdzYMzRU557NxJ-UwtE9mOI,3525
|
|
12
|
-
troubadix/plugins/__init__.py,sha256=
|
|
12
|
+
troubadix/plugins/__init__.py,sha256=SqunGwbE9ReOyhRLgoSAo6zxvKWhQdvWVWlnS8kKys4,8754
|
|
13
13
|
troubadix/plugins/badwords.py,sha256=k1A1d2pdXzie87FGGXrykP2BgdZbY5QtmQItupHtNyw,4701
|
|
14
14
|
troubadix/plugins/copyright_text.py,sha256=jYsLWmTbT_A78XQQxQFK-5kMMHkh3xdvlh7mEF2dZGU,3583
|
|
15
15
|
troubadix/plugins/copyright_year.py,sha256=XzM9MHVzOXwNLwHpfuaWj8PUOmswr56SBVOLBdvxjd4,5478
|
|
@@ -98,8 +98,8 @@ troubadix/standalone_plugins/last_modification.py,sha256=ROzwVzzYilXJ0llVt4Lv0w8
|
|
|
98
98
|
troubadix/standalone_plugins/no_solution.py,sha256=p_-az9Igl4GH6HnhLLYbYlWIiEP64OTQLpX-z3JAshs,8760
|
|
99
99
|
troubadix/standalone_plugins/version_updated.py,sha256=6YHF0OjL5NWszQdsSh7XzlSji1e6Uaqwu_Y6m3R0mvI,4203
|
|
100
100
|
troubadix/troubadix.py,sha256=5__Jz3bYSrya4aG6RCBWxqnsDepXfwXZ3v0bjCzEFi0,6039
|
|
101
|
-
troubadix-25.3.
|
|
102
|
-
troubadix-25.3.
|
|
103
|
-
troubadix-25.3.
|
|
104
|
-
troubadix-25.3.
|
|
105
|
-
troubadix-25.3.
|
|
101
|
+
troubadix-25.3.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
102
|
+
troubadix-25.3.3.dist-info/METADATA,sha256=6WS3yLPwR9a83b4Xc4RNhqISrOWddfYAB4px3jUsDw8,4462
|
|
103
|
+
troubadix-25.3.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
104
|
+
troubadix-25.3.3.dist-info/entry_points.txt,sha256=SnhEUe4W76P-ADmO9J355gRztTyHU_PTxRewKy3-e5o,832
|
|
105
|
+
troubadix-25.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|