Skip to content

Document our approach on going to Standard style #70

Open

Description

@LinusU

We are currently converting the code base into Standard style by converting each line that we touch when making changes. This approach is very nice since it doesn't introduce any additional conflicts and makes backporting work well.

However, I've never seen this actually documented somewhere. It would be nice if we could write down what we are doing, and why we are doing it. Maybe in the contributor guide.

We're following the same approach in node-canvas and I would love to be able to link to the description from there 😄

Activity

  1. gireeshpunathil commented on Mar 25, 2020

    @gireeshpunathil

    converting each line that we touch when making changes.

    @LinusU - mind expanding this for a better context? is it actioned already, and a close-candidate? or if there is anything that needs to be documented, let me know!

  2. LinusU commented on Mar 25, 2020

    @LinusU
    MemberAuthor

    I think that the thing left to do is better explain what we are doing, and why we are doing it.

    The short explanation is that we're converting each line that we are modifying to Standard style, and the short why is that we are doing it to preserve git blame and to not cause unnecessary conflicts.

    As far as actionable things to do, I think that we need to elaborate on this, and then write it down somewhere ☺️

  3. jonchurch commented on Mar 26, 2020

    @jonchurch
    Member

    Unrelated to documentation, but a tool similar to https://github.com/grvcoelho/lint-diff could be useful to automate applying standardjs formatting only to lines which are changed.

    Similar to but different than the commonly employed https://github.com/okonet/lint-staged which lints an entire file once staged by git add. Or this one, precise-commits

    Edit: Turns out this is not an easily solved problem 🤦‍♂. If anyone wants to help out on this point, please do. Precise-commits seems the most popular, but it uses prettier under the hood. Prettier has some bugs in its range based formatting which can mess up indenting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions