eftafmo / dataviz

Data visualisation website for EEA & Norway grants
https://data.eeagrants.org
1 stars 3 forks source link

code made prettier #594

Closed rexalex closed 2 years ago

rexalex commented 3 years ago

formatted code with prettier, added prettier to project

xlotlu commented 3 years ago

Objectively speaking, the primary problem with this PR is that it breaks git blame, both in that you can't follow the code down to its actual source commit, and that it makes someone else appear as the author of said code.

This could be averted however with a full history rewrite, using git-filter-repo and applying the "prettyfication" to each commit. It's a bit of work, but it's not all that complicated, and we can afford to do it since this isn't a public-facing open-source project with many committers and many deployments.

Now, subjectively, I strongly disapprove with such a practice. The two main reasons are that it normalises OCD, and more importantly that it loses resolution. That is, it erases meaning that the original author might have placed there by means of a particular newline, or a particular comma. That it standardises on single quotes or double quotes may be a good thing, unless the original author had in mind, say, that single quotes are to be used for identifiers while double quotes for textual strings.

The fact that I am the original author of course doesn't help, since obviously my code is poetry and it's perfect and it should simply be left as is. Joking aside, I do take great care in the custom formatting that I do, and every change that that blunt tool did undoes something that was purposeful and made sense to me.

In the end, I think this is an organisational decision, but if the decision is pro-change, it should only be done with a history rewrite, not as a single commit.