Giter Site home page Giter Site logo

Comments (5)

paul-dingemans avatar paul-dingemans commented on June 27, 2024 1

Sorry but this will not be implemented as it conflicts with chain-method-continuation which aligns/wraps all . and ?. before call expressions. Also, there will be no option added to make this configurable (https://pinterest.github.io/ktlint/latest/faq/#can-a-new-toggle-be-added-to-optionally-enabledisable-format-code-in-a-particular-way).

from ktlint.

Kolyall avatar Kolyall commented on June 27, 2024

@paul-dingemans it conflicts with chain-method-continuation only if chain-method-continuation = 1.
And in this case you may notify user about this conflict

from ktlint.

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

only if chain-method-continuation = 1.

What do you mean with this?

from ktlint.

Kolyall avatar Kolyall commented on June 27, 2024

@paul-dingemans
Cases:

  1. If config is:
ktlint_standard_chain-method-continuation = 1
ij_kotlin_wrap_first_method_in_call_chain = false

Expected result will be:
conflict

  1. If config is:
ktlint_standard_chain-method-continuation = 2
ij_kotlin_wrap_first_method_in_call_chain = false

Expected result will be:

viewModel.getUserStatus()
            .onEach {}
            .launchIn(viewLifecycleOwner.lifecycleScope)
  1. If config is:
ktlint_standard_chain-method-continuation = 3
ij_kotlin_wrap_first_method_in_call_chain = false

Expected result will be:

viewModel.getUserStatus().onEach {}
            .launchIn(viewLifecycleOwner.lifecycleScope)

from ktlint.

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

Why do you think that property ktlint_standard_chain-method-continuation can have a numeric value? This property can only be set with value enabled or disabled. The only numeric property for this rule is ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than. See https://pinterest.github.io/ktlint/latest/rules/experimental/#chain-method-continuation.

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.