Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra_filetypes: c fails #659

Closed
HugoMVale opened this issue Jul 29, 2024 · 2 comments · Fixed by #660
Closed

extra_filetypes: c fails #659

HugoMVale opened this issue Jul 29, 2024 · 2 comments · Fixed by #660

Comments

@HugoMVale
Copy link

I tried adding extra_filetypes: c to the metadata block in the project file, but it results in immediate failure.
Any idea what might be the cause?

PS C:\Code\odrpack95> ford --version        
ford version 7.0.8
PS C:\Code\odrpack95> ford .\api-doc-ford.md
Traceback (most recent call last):
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\Scripts\ford.exe\__main__.py", line 7, in <module>
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\__init__.py", line 485, in run
    proj_data, proj_docs = initialize()
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\__init__.py", line 141, in initialize
    proj_docs, proj_data = load_settings(proj_docs, directory, args.project_file.name)
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\__init__.py", line 320, in load_settings
    proj_data, proj_docs = load_markdown_settings(directory, proj_docs, filename)
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\settings.py", line 312, in load_markdown_settings
    settings = convert_types_from_metapreprocessor(ProjectSettings, settings, filename)
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\settings.py", line 384, in convert_types_from_metapreprocessor
    settings[key] = convert_setting(default_type, key, value)
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\settings.py", line 356, in convert_setting
    file_types = [ExtraFileType.from_string(string) for string in resvalue]
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\settings.py", line 356, in <listcomp>
    file_types = [ExtraFileType.from_string(string) for string in resvalue]
  File "C:\Users\hugom\.pyenv\pyenv-win\versions\3.10.10\lib\site-packages\ford\settings.py", line 112, in from_string
    file_type = cls(parts[0], parts[1])
IndexError: list index out of range
@ZedThree
Copy link
Member

Ah, that's not a very helpful error message, but I think the error is due to the format. You need to include the comment syntax too:

extra_filetypes: c //

@HugoMVale
Copy link
Author

Thanks a lot for the quick explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants