diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2be9e2..401c293 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,8 @@ +--- default_language_version: python: python repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-merge-conflict @@ -15,16 +16,20 @@ repos: exclude: ChangeLog-spell-corrected.diff - id: check-json exclude: mathics_scanner/data/character-tables.json -- repo: https://github.com/pycqa/isort + - repo: https://github.com/pycqa/isort rev: 5.13.2 hooks: - id: isort stages: [pre-commit] args: ["--profile", "black"] -- repo: https://github.com/psf/black + - repo: https://github.com/psf/black rev: 25.11.0 hooks: - id: black language_version: python3 stages: [pre-commit] exclude: version.py + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.31.0 # Use the latest version + hooks: + - id: check-github-workflows diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..1052c4f --- /dev/null +++ b/.yamllint @@ -0,0 +1,4 @@ +# -*- conf -*- +# .yamllint configuration file +rules: + line-length: disable diff --git a/mathics_scanner/location.py b/mathics_scanner/location.py index 1f309bb..1153692 100644 --- a/mathics_scanner/location.py +++ b/mathics_scanner/location.py @@ -75,6 +75,9 @@ def get_location_file_line( filename = code.co_filename line_number = code.co_firstlineno else: - filename = MATHICS3_PATHS[loc.container] + try: + filename = MATHICS3_PATHS[loc.container] + except IndexError: + filename = "???" line_number = loc.start_line return filename, line_number diff --git a/pyproject.toml b/pyproject.toml index 0eec94d..0d3bf7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,6 @@ classifiers = [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Programming Language :: Python", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -45,6 +44,8 @@ Homepage = "https://mathics.org/" [project.optional-dependencies] dev = [ + "check-jsonschema", + "pre-commit", "pytest", ] full = [