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

Documentation parser breaks when malformed `:param` string is passed #2143

Closed
arafsheikh opened this Issue May 14, 2016 · 3 comments

Comments

7 participants
@arafsheikh
Member

arafsheikh commented May 14, 2016

When :param some_parameter is used instead of :param some_parameter: the following error is received.

[WARNING][20:43:05] The default coafile '.coafile' was not found. Ignoring it.
[ERROR][20:43:05] An unknown error occurred. This is a bug. We are sorry for the inconvenience. Please contact the developers for assistance. During execution of coala an exception was raised. This should never happen. When asked for, the following information may help investigating:
[DEBUG][20:43:05] Exception was:
Traceback (most recent call last):

  File "/usr/local/lib/python3.4/dist-packages/coalib/coala_main.py", line 62, in run_coala
    autoapply=autoapply)

  File "/usr/local/lib/python3.4/dist-packages/coalib/settings/ConfigurationGathering.py", line 310, in gather_configuration
    log_printer)

  File "/usr/local/lib/python3.4/dist-packages/coalib/settings/SectionFilling.py", line 38, in fill_settings
    fill_section(section, acquire_settings, log_printer, all_bears)

  File "/usr/local/lib/python3.4/dist-packages/coalib/settings/SectionFilling.py", line 74, in fill_section
    needed = bear.get_non_optional_settings()

  File "/usr/local/lib/python3.4/dist-packages/coalib/bears/Bear.py", line 196, in get_non_optional_settings
    return cls.get_metadata().non_optional_params

  File "/usr/local/lib/python3.4/dist-packages/coalib/bearlib/abstractions/Linter.py", line 228, in get_metadata
    cls._get_create_arguments_metadata())

  File "/usr/local/lib/python3.4/dist-packages/coalib/bearlib/abstractions/Linter.py", line 200, in _get_create_arguments_metadata
    omit={"filename", "file", "config_file"})

  File "/usr/local/lib/python3.4/dist-packages/coalib/settings/FunctionMetadata.py", line 148, in from_function
    doc_comment = DocumentationComment.from_docstring(doc)

  File "/usr/local/lib/python3.4/dist-packages/coalib/settings/DocumentationComment.py", line 48, in from_docstring
    param_dict[cur_param] = splitted[1].strip()

IndexError: list index out of range
@gitmate-bot

This comment has been minimized.

Show comment
Hide comment
@gitmate-bot

gitmate-bot May 14, 2016

Collaborator

Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this issue!

CC @sils1297, @AbdealiJK

Collaborator

gitmate-bot commented May 14, 2016

Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this issue!

CC @sils1297, @AbdealiJK

@arafsheikh arafsheikh changed the title from `:param` breaks documentation parser to Documentation parser breaks when malformed `:param` string is passed May 14, 2016

@sils

This comment has been minimized.

Show comment
Hide comment
@sils

sils May 14, 2016

Member

Needs proper error handling with a nice message

Member

sils commented May 14, 2016

Needs proper error handling with a nice message

@Makman2 Makman2 added the type/bug label May 14, 2016

@SanketDG SanketDG assigned damngamerz and unassigned SanketDG Jun 2, 2017

@NiklasMM

This comment has been minimized.

Show comment
Hide comment
@NiklasMM

NiklasMM Jun 16, 2017

Contributor

Since :param some_parameter is clearly a malformed docstring it's ok to just yield a Result in this case.

Contributor

NiklasMM commented Jun 16, 2017

Since :param some_parameter is clearly a malformed docstring it's ok to just yield a Result in this case.

damngamerz added a commit to damngamerz/coala that referenced this issue Jun 25, 2017

DocumentationComment: Fix missing ending colon
Fix for missing ending colon, which made parser
to break.
Fixes coala#2143

@rultor rultor closed this in #4407 Jun 25, 2017

S2606 added a commit to S2606/coala that referenced this issue Jun 27, 2017

DocumentationComment: Fix missing ending colon
Fix for missing ending colon, which made parser
to break.
Fixes coala#2143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment