Skip to content

Comment on Anon died on the "clang format bad" hill

You are viewing one comment and its replies. View all comments

Comments

  • Linters are terrible.

    Style/formatting linters, anyway, particularly when it comes to whitespace. The goal of formatting code with whitespace is to optimize for human readability. A linter based on a set of rules is not human and thus cannot judge human readability. There is really no formatting rule you can write that will not someday have exceptions on a large-enough codebase.

    Contributors should be responsible for submitting readable code, and ensuring that is what reviews are for.

    0
    • …which is why I love #[rustfmt::skip] so much! You can do stuff like

      #[rustfmt::skip]  
      const DIRECTIONS: [[i8; 2]; 4] = [  
                   [0, 1],  
          [-1, 0],          [1, 0],  
                   [0, -1],  
      ];  
      

      while still enjoying the convenience of auto formatting elsewhere.

      Although linters which act on the behavior of code are unequivocally a good thing, e.g. “hey, this comparison will always return false you probably made a mistake here”.

      0

Sign in to comment. Sign in