I have an issue with working in the (local, forked...
# modules
i
I have an issue with working in the (local, forked) modules repo. I've asked in #nostupidquestions before but got no solution. For some reason, pre-commit started to run locally. It fails the yaml schema check, as it apparently misses the symlink and believes the content of
yaml-schema.json
is the string
meta-schema.json
, rather than the file content. Due to this, I cannot commit any changes. Does someone know what causes the issue and how it can be solved?
j
is your branch up to date?
i
I've merged changes from nf-core to my fork and pulled, so it should be up to date
j
i
Yes, it's identical
j
pointing to
meta-schema.json
and not
yaml-schema.json
? 🤔
what is the exact error you see?
i
Copy code
Match meta.ymls in one of the subdirectories of modules/nf-core............................Failed
- hook id: check-jsonschema
- exit code: 1

Error: schemafile could not be parsed as JSON
SchemaParseError: /home/igor/Work/modules/modules/yaml-schema.json
  in "/home/igor/.cache/pre-commit/repoxg0jzlui/py_env-python3.10/lib/python3.10/site-packages/check_jsonschema/checker.py", line 53
  >>> return self._schema_loader.get_validator(

  caused by

  FailedFileLoadError: Failed to parse /home/igor/Work/modules/modules/yaml-schema.json
    in "/home/igor/.cache/pre-commit/repoxg0jzlui/py_env-python3.10/lib/python3.10/site-packages/check_jsonschema/schema_loader/readers.py", line 27
    >>> schema = callback()

    caused by

    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
      in "/home/igor/.cache/pre-commit/repoxg0jzlui/py_env-python3.10/lib/python3.10/site-packages/check_jsonschema/parsers/__init__.py", line 92
      >>> return loadfunc(data)

      caused by

      StopIteration: 0
        in "/home/igor/miniforge3/lib/python3.10/json/decoder.py", line 353
        >>> obj, end = self.scan_once(s, idx)
j
weird!
so, a workaround for now is to add the option
--no-verify
when you commit
this will skip running pre-commit
until we know what is going on
i
Makes even less sense
j
can you try to link yaml-schema.json to meta-schema.json?
i
It seems re-linking has fixed it
👏🏻 1