mayflower / mo4-coding-standard

MO4 Coding Standard Rules for Codesniffer based on Symfony Coding Standards.
MIT License
17 stars 10 forks source link

ruleset: disable `BlockControlStructureSpacing` sniff for most tokens #165

Closed Ma27 closed 3 years ago

Ma27 commented 3 years ago

Type of PR

Breaking changes

Description

I don't like this rule since variable assignments before such a block shouldn't be a blank-line away if those are related to the block itself.

For instance

$foo = 'bar';
if ($this->returnBool($foo)) {
    // ...
}

makes immediately clear that $foo is related to the control structure in contrast to

$foo = 'bar';

if ($this->returnBool($foo)) {
    // ...
}
mmoll commented 3 years ago

I'm unhappy with this, but let's vote with reactions +1/-1 above.

codecov[bot] commented 3 years ago

Codecov Report

Merging #165 (20584af) into master (f71240d) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##              master      #165   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       133       133           
===========================================
  Files              6         6           
  Lines            511       511           
===========================================
  Hits             511       511           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f71240d...20584af. Read the comment docs.

xalopp commented 3 years ago

This is related to #7 .

With #7 the empty line before control structures has been taken as a MO4 standard. Unsure if this decision can be reverted.

Ma27 commented 3 years ago

@xalopp for now, the main question is IMHO whether you're in favor or against it :)

I think that a revert is fine if a feature is only removed if

Ma27 commented 3 years ago

Closing now as it seems as I'm the only one who seems to care about this.