Git Product home page Git Product logo

Comments (7)

sidz avatar sidz commented on July 18, 2024

Hi @FlorentTorregrosa

Nope it is not possible to ignore a specific line of code in this moment.

from phpmnd.

FlorentTorregrosa avatar FlorentTorregrosa commented on July 18, 2024

Hi @sidz,

Thanks for the quick reply. Ok, so I didn't miss something :)

from phpmnd.

exussum12 avatar exussum12 commented on July 18, 2024

You can ignore every instance by using intval(10) instead of just 10. It's not ideal as you wouldn't know by looking at intval(10) that it's used to ignore a check for phpmnd.

Sounds a good feature request though :)

from phpmnd.

FlorentTorregrosa avatar FlorentTorregrosa commented on July 18, 2024

Yes and also it adds unneeded function calls.

I also tried to use string, the Drupal form API is enough permissive to do that, but I don't want to do that too. Typing is more and more enforced and changing the values type just to satisfy a code quality tool is a non-sense in my opinion.

Thanks for your feedback :)

from phpmnd.

exussum12 avatar exussum12 commented on July 18, 2024

Yeah agreed. I think the same about comments to ignore lines tbh. The array key whitelist is not a bad idea.

There is also a check in phpmnd for numeric strings which is good to enable as well. Which stops just hiding numbers by converting to a string

from phpmnd.

povils avatar povils commented on July 18, 2024

I like the feature to ignore specific array keys :) I see how it could be useful

from phpmnd.

MGatner avatar MGatner commented on July 18, 2024

I would love to add this tool to my default workflow but it runs against 30+ projects and being able to "exempt" individual lines would be absolutely crucial. The array keys bit is not a deal-breaker for me, especially since you could always do this:

$weight = 10; // @phpmnd-ignore-line
$data = [
    'weight' => $weight,
];

I would like to put forth a bounty on the line exemption comment feature - anyone willing to match? @exussum12 Can you provide a fair amount or expected time to implement?

from phpmnd.

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.