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

Generic/Todo-Fixme sniffs: improve handling of docblock tags and efficiency fix #3771

Closed

Commits on Mar 2, 2023

  1. Generic/Todo-Fixme: make the sniffs more selective

    The sniffs as-they-were, would sniff all comment related tokens, including `T_DOC_COMMENT_STAR`, `T_DOC_COMMENT_WHITESPACE` etc.
    
    Sniffing those tokens is redundant and makes the sniffs slower than is needed.
    
    Fixed now by making the tokens being registered by the sniffs more selective/targetted.
    jrfnl committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    8d4f75a View commit details
    Browse the repository at this point in the history
  2. Generic/Todo: improve handling of "todo" tags in docblocks

    Until now, the sniff would only examine an individual comment token, while when a `@todo` tag is used in a docblock, the "task description" is normally in the next `T_DOC_COMMENT_STRING` token.
    
    This commit fixes this and the sniff will now take docblock `@todo` tags into account.
    
    Includes additional unit tests.
    jrfnl committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    7ff8863 View commit details
    Browse the repository at this point in the history
  3. Generic/Fixme: improve handling of "fixme" tags in docblocks

    Essentially the same fix as applied in the sister-commit for the `Generic.Commenting.Todo` sniff.
    
    Until now, the sniff would only examine an individual comment token, while when a `@fixme` tag is used in a docblock, the "task description" is normally in the next `T_DOC_COMMENT_STRING` token.
    
    This commit fixes this and the sniff will now take docblock `@fixme` tags into account.
    
    Includes additional unit tests.
    jrfnl committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    9db1e42 View commit details
    Browse the repository at this point in the history