Tue, 31 May 2022 09:59:42 +0200
Syntax Checker
- changed the TOML syntax checker to use 'tomlkit' because 'toml' is no longer maintained
--- a/docs/changelog Mon May 30 09:51:57 2022 +0200 +++ b/docs/changelog Tue May 31 09:59:42 2022 +0200 @@ -14,6 +14,9 @@ -- updated the list of known UF2 capable boards - pip Interface -- added a filter to the package licenses dialog +- Syntax Checker + -- changed the TOML syntax checker to use 'tomlkit' because 'toml' is no + longer maintained - Testing -- reworked the former unittest interface to allow to support testing frameworks other than "unittest"
--- a/eric7/Plugins/CheckerPlugins/SyntaxChecker/tomlCheckSyntax.py Mon May 30 09:51:57 2022 +0200 +++ b/eric7/Plugins/CheckerPlugins/SyntaxChecker/tomlCheckSyntax.py Tue May 31 09:59:42 2022 +0200 @@ -173,19 +173,21 @@ @rtype dict """ try: - import toml + import tomlkit + from tomlkit.exceptions import ParseError except ImportError: - error = "toml not available. Install it via the PyPI interface." + error = "tomlkit not available. Install it via the PyPI interface." return [{'error': (file, 0, 0, '', error)}] codestring = normalizeCode(codestring) try: - toml.loads(codestring) - except toml.TomlDecodeError as exc: - line = exc.lineno - column = exc.colno - error = exc.msg + tomlkit.parse(codestring) + except ParseError as exc: + line = exc.line + column = exc.col + error = str(exc).split(" at ", 1)[0].strip() + # get error message without location cline = min(len(codestring.splitlines()), int(line)) - 1 code = codestring.splitlines()[cline]
--- a/scripts/install-dependencies.py Mon May 30 09:51:57 2022 +0200 +++ b/scripts/install-dependencies.py Tue May 31 09:59:42 2022 +0200 @@ -45,7 +45,7 @@ "docutils", "Markdown", "pyyaml", - "toml", + "tomlkit", "chardet", "asttokens", "EditorConfig",
--- a/scripts/install.py Mon May 30 09:51:57 2022 +0200 +++ b/scripts/install.py Tue May 31 09:59:42 2022 +0200 @@ -1609,7 +1609,7 @@ "docutils": ("docutils", ""), "Markdown": ("markdown", ""), "pyyaml": ("yaml", ""), - "toml": ("toml", ""), + "tomlkit": ("tomlkit", ""), "chardet": ("chardet", ""), "asttokens": ("asttokens", ""), "EditorConfig": ("editorconfig", ""),