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

Document our approach on going to Standard style #70

Open
LinusU opened this issue Nov 20, 2018 · 3 comments
Open

Document our approach on going to Standard style #70

LinusU opened this issue Nov 20, 2018 · 3 comments

Comments

@LinusU
Copy link
Member

LinusU commented Nov 20, 2018

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 😄

@gireeshpunathil
Copy link

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!

@LinusU
Copy link
Member Author

LinusU commented Mar 25, 2020

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 ☺️

@jonchurch
Copy link
Member

jonchurch commented Mar 26, 2020

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants