Code Monkey home page Code Monkey logo

Comments (6)

OwlyCode avatar OwlyCode commented on June 16, 2024 1

We can add this. I have very little available time at the moment for open source projects. If you want to help you can add this or I will do it but that will take some time.

from twigcs.

OwlyCode avatar OwlyCode commented on June 16, 2024

Hello,

As of https://twig.symfony.com/doc/2.x/coding_standards.html it is stated :

Put one (and only one) space after the start of a delimiter ({{, {%, and {#) and before the end of a delimiter (}}, %}, and #}):

My understanding of this is that you should format like this :

{% set classes = [
    'block',
    'block-' ~ configuration.provider|clean_class,
    'block-' ~ plugin_id|clean_class,
] %}

But you can still use custom rules with Twigcs.

from twigcs.

Chi-teck avatar Chi-teck commented on June 16, 2024

My understanding of this is that you should format like this

That's how we work around right now. But this kind of formatting does not look well.

from twigcs.

OwlyCode avatar OwlyCode commented on June 16, 2024

I personally got quite used to it, it saves 2 lines in vertical space. But that's pure opinion without any facts.

Twigcs is not about forcing you to do this. The tool is meant to allow you to enforce the rules you want in your project. In your case you should go with a custom Ruleset so you can set up the coding style that suits you.

from twigcs.

Chi-teck avatar Chi-teck commented on June 16, 2024

Yes, but the rule (DelimiterSpacing) has no configuration options to change that behavior. So besides the Ruleset we will have to develop a new Rule for that.

from twigcs.

Chi-teck avatar Chi-teck commented on June 16, 2024

I am not quite familiar with Twig lexer. So I think it ls better to leave this for you.
Thanks.

from twigcs.

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.