Giter Site home page Giter Site logo

Suggestions about phpstan-todo-by HOT 7 CLOSED

m29corey avatar m29corey commented on May 18, 2024
Suggestions

from phpstan-todo-by.

Comments (7)

staabm avatar staabm commented on May 18, 2024
  1. Make the code case-insensitive. This would include changing the pattern by adding an "i" after the closing slash, and change other string comparison sections to make the subject match case of the comparison.

I did this intentionally to reduce the performance impact of the rule. it might make sense make it configurable so people which prefer e.g. lowercase // todo can be supported

2. Add an optional "@" to the start of the pattern.
I preface my todo comments with "@" for IDE highlighting reasons.

how do your comments look like, please provde a example

3. Use named capture groups in the regular expression:

I am fine with the code as is right now

4. Make your variable interpolation consistent.

feel free to provide a PR if this is something important to you :-)

from phpstan-todo-by.

voku avatar voku commented on May 18, 2024
  1. Add an optional "@" to the start of the pattern.
    I preface my todo comments with "@" for IDE highlighting reasons.

I also add "@" for the same reason, it looks like this: https://www.jetbrains.com/help/phpstorm/using-todo.html#add_pattern_filter_todo

e.g. TODO@lars -> ...

from phpstan-todo-by.

apfelbox avatar apfelbox commented on May 18, 2024

I would love support for @todo, as that is the format we typically use.

from phpstan-todo-by.

staabm avatar staabm commented on May 18, 2024

I would love support for @todo, as that is the format we typically use.

could you give a complete example of how your comment looks like?

looks like some of you guys are talking about // @todo and some are talking about // TODO@xy

from phpstan-todo-by.

m29corey avatar m29corey commented on May 18, 2024

Here is a couple of examples of an @todo from one of my projects:

/**
 * @todo - Convert to standard Drupal $content code.
 */
...
// @todo Decide to fix all the broken instances of class as a string

Some comments have the hyphen, some don't.

from phpstan-todo-by.

m29corey avatar m29corey commented on May 18, 2024

I made a pull request with my suggested changes, and added in support for php doc comments.
I tested this on a large project and saw no significant performance loss compared to PHPStan not using this plugin.

from phpstan-todo-by.

github-actions avatar github-actions commented on May 18, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from phpstan-todo-by.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.