Giter Site home page Giter Site logo

Comments (3)

TribuneX avatar TribuneX commented on June 2, 2024

Seems that I need to set ktlint_standard_function-signature = enabled instead, although this rule is listed as an experimental rule?

This is not clear to me reading the docs:

This setting only takes effect when rule function-signature is enabled.

Maybe its worth adding an example how to enable this?

from ktlint.

paul-dingemans avatar paul-dingemans commented on June 2, 2024

Seems that I need to set ktlint_standard_function-signature = enabled instead, although this rule is listed as an experimental rule?

There was already a kind of warning on top of the Experimental Rules documentation:
Screenshot 2023-05-17 at 18 10 40

Would it be more clear if I change the last line this message as follows?

Or, when a specific experimental rule is provided in rule set with id rule-set-id, it can be enabled via .editorconfig property ktlint_<rule-set-id>_<rule-id>.

I will change all rule ids on the experimental and standard rules pages to the fully qualified rule id.

This is not clear to me reading the docs:

This setting only takes effect when rule function-signature is enabled.
Maybe its worth adding an example how to enable this?

This means that the experimental rule function-signature needs to be enabled. Either enable all experimental rules or enable this specific rule.

from ktlint.

TribuneX avatar TribuneX commented on June 2, 2024

I think my first confusion is mostly because it was not clear if the rule ktlint_function_signature_body_expression_wrapping is a standard rule or an experimental rule, since its listed under KtLint configuration. I guess its neither of both.
However, I did not know how to translate this advice into a .editorconfig:

This setting only takes effect when rule function-signature is enabled.

Maybe just add the following:

This setting only takes effect when rule function-signature is enabled (e.g. via ktlint_standard_function-signature = enabled in your .editorconfig).

The second confusion was because of this sentence in the important box:

Or, when a specific experimental rule is enabled via .editorconfig property ktlint_<rule-set-id>_<rule-id>.

I am missing some information about what the rule-set-id actual is. I though function-signature is the rule-id and since this is an experimental rule experimental would be the rule-set-id. But its ktlint_standard_function-signature instead.

Is that because the first sentence in the box states?

Experimental rules in ktlint are part of the standard ruleset.

I think some pointer on what a rule-set-id actually is would help to make it easier to understand the required config keys.

from ktlint.

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.