Skip to content

Add whitespace check to CI #8316

Closed

Description

@andreasabel

Activity

  1. chshersh commented on Jul 25, 2022

    @chshersh
    Member

    I would like to highlight the importance of this issue (an #6370 as well) by sharing my anecdotal story about contributing to cabal.

    Several years ago I've submitted a patch to Cabal and part of the changes were whitespaces cleanups in a couple of lines. Trailing whitespaces were automatically removed by my editor and I haven't figured how to disable this automatic cleanup.

    I thought that a few lines is not a big deal. But to my surprise, PR reviewers told me that next time it's better to put all such cleanups in separate commits. It felt extremely off-putting to me and I immediately stopped contributing to Cabal after that. I'm not going to spend my free time configuring my editor to disable whitespace cleanup just for a single codebase (especially when I don't know how to do this) and I'm definitely not going to do extra work just to put a few trailing whitespaces removals in separate commits.


    This is just a single example but I might not be the only one who had similar experiences. If we cleanup all whitespaces in Cabal and put this check on CI, we remove the possibility of having such conversation in the first place. On top of that, if all commits are going to be "Squashed and Merged" eventually, it doesn't make sense to spend time putting them into separate commits.

  2. philderbeast commented on Jul 25, 2022

    @philderbeast
    Collaborator

    I've been contributing some hlint fixes to liquid haskell and liquid fixpoint projects and sometimes using HLS in vscode to apply the fix. This can result in lots of whitespace trimming at the end of lines. Tooling including the github web one for review of code changes in a pull request can hide these whitespace changes. Here's a small example of what can happen:

    https://github.com/ucsd-progsys/liquid-fixpoint/pull/580/files

  3. self-assigned this
    on Jul 25, 2022
  4. added a commit that references this issue on Jul 25, 2022
    5fb80f7
  5. andreasabel commented on Jul 25, 2022

    @andreasabel
    MemberAuthor

    Yes, we (at least I) don't want to review PRs where whitespace changes are sprinkled all over. It is best practice to place these into a separate commit. Esp. you don't want to get the confusion of merge/rebase conflicts because of whitespace issues. If they are in a separate commit they are easier to handle.
    However, it is also best practice to keep the repo free of whitespace issues all the time. A tool such as https://github.com/agda/fix-whitespace can help here.

  6. added 4 commits that reference this issue on Jul 25, 2022
    95614ae
    9691f1c
    52ea337
    93deded
  7. added a commit that references this issue on Jul 28, 2022
    4eaf711
  8. added
    re: code quality
    on Jul 28, 2022
  9. added a commit that references this issue on Oct 7, 2022
    4bf957d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

continuous-integrationnewcomerre: code quality

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions