Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chop down long chained calls and force brackets on if #3296

Merged
merged 1 commit into from Sep 19, 2019

Conversation

christophsturm
Copy link
Contributor

No description provided.

Copy link
Contributor

@chimp1984 chimp1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Just quickly tried it out with streams and looks ok.

@ripcurlx ripcurlx merged commit 9c82510 into bisq-network:master Sep 19, 2019
@mrosseel
Copy link
Member

Not sure what the current status is of .editorconfig ?
Being ide-agnostic seems like a win for me, maybe the idea config is more convenient but then maybe also keep .editorconfig in sync as much as possible?

@chimp1984
Copy link
Contributor

NACK

Actually it does not behave as i would like:

If its not a long line it makes it a one-liner. I prefer linebreaks at all non-trivial stream expressions for better redibility.

 public Optional<TxOutput> getLockupTxOutput(String txId) {
        return getTx(txId).flatMap(tx -> tx.getTxOutputs().stream().filter(this::isLockupOutput).findFirst());
    }
   public Optional<TxOutput> getLockupTxOutput(String txId) {
        return getTx(txId).flatMap(tx -> tx.getTxOutputs().stream()
                .filter(this::isLockupOutput)
                .findFirst());
    }

@ripcurlx
Copy link
Member

NACK

Actually it does not behave as i would like:

If its not a long line it makes it a one-liner. I prefer linebreaks at all non-trivial stream expressions for better redibility.

 public Optional<TxOutput> getLockupTxOutput(String txId) {
        return getTx(txId).flatMap(tx -> tx.getTxOutputs().stream().filter(this::isLockupOutput).findFirst());
    }
   public Optional<TxOutput> getLockupTxOutput(String txId) {
        return getTx(txId).flatMap(tx -> tx.getTxOutputs().stream()
                .filter(this::isLockupOutput)
                .findFirst());
    }

Unfortunately merged it already because of the utACk before. @christophsturm could you address the comments in another PR?

@chimp1984
Copy link
Contributor

@ripcurlx @christophsturm @freimair
Lets try to get to a final version soon and then make a reformat of the whole code base to avoid future format diffs. After that, there should be only changes if super important as a full reformat should not become a standard procedure. Leaving a bit of freedom to devs about their preferred style is ok IMO as well. Usually there is a main dev for a class so it can carry a bit of his signature...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants