Open eddiemonge opened 10 years ago
A couple projects we'd need on Yeoman. I'm just listing them here, and then we should open issues with requirements details.
.editorconfig
for config and normalize whitespacefile-utils
write filters.Some similar/related ideas around OSS in general:
Oh, we don't use any bounty or sponsor system actively ATM.
I've tried both BountySource and gittip. None of them has ever worked.
good to know.
Incentives like interesting tasks, tshirts and get-togethers are much more appealing.
:+1: for stickers and t-shirts :) my own personal motivation / incentive is writing re-usable code.
certainly, I only meant to get more $$ sponsorship out of businesses to help with the cost of setting up a hackathon of this size.
@sindresorhus just sent you an email regarding the Toronto Hackathon we're setting up...
@SBoudrias it's easy to read an .editorconfig file, but how do you propose to normalize the whitespace on a variety of file formats?
@jedmao see for more details #5 - but whitespace is pretty easy as you don't need to know the file format (just that it is text base). So you detect the indentation, then replace each indentation character at line start with the new specified indent char.
@jedmao also, couldn't https://github.com/jedmao/eclint be used too?
@SBoudrias no. This is why I bring it up. If you have EditorConfig set with indent_style = tab
and you have a line of code with 4 spaces at the beginning, you can't assume that means 2 indentations; thus, you can't replace them with 2 tabs.
var first = 'Jed',
last = 'Mao';
Replacing the leading spaces on line 2 with tabs would be introducing tabs for alignment, which is a huge no no! This is why I propose compatible template files be written with leading tabs for indentation and spaces that follow for alignment. It's a one-way operation. It cannot be reversed! Tabs for indentation is the only way to preserve one's intent for alignment.
By all means, if someone has a better idea, let me know!
You could use https://github.com/sindresorhus/detect-indent to detect the indentation.
i thought you just made that on the spot. that usually seems like the case when you link a module
@eddiemonge the initial commits were on August 10th, 2013, so it's been out for a while now.
@sindresorhus, I know how to detect indentation, but even your detect-indent module is not reliable. You even say so in on line 55 of index.js:
// greatest common divisor is most likely the indent size
That's my point, is that when spaces are used for indentation, we can't rely on conversions. We can only guess and, when converting to tabs, potentially introduce tabs for alignment.
This is a hackathon idea thread right, so we don't really care if it is not 100% perfect. OSS live and improve over time - and the issue of indentation seems to be resolvable (even more with the help of beautifier normalizing the output).
@jedmao I would argue that's an edge-case and if so we could take the gcd of all the files. We also know the indentation from our own template files, so I don't see this as a huge problem.
@sindresorhus I don't see how this is an edge case. Knowing the indentation doesn't help you one bit. There's still a lot of people who prefer hard tabs and all the template files I've seen use spaces for both indentation and alignment. This is the problem. Even if you know the indentation ahead of time, you still can't convert the template file into tabs w/o accidentally introducing tabs for alignment. The only reliable way to do this is if the template files use tab characters for indentation, followed by spaces for alignment. Then, you can convert it into any desired indentation setting w/o issues.
Yeah, true. If we have support for respecting indentation I have no issue having the source templates in tabs. Makes total sense.
https://github.com/tastejs/todomvc/wiki/Sample-app-ideas