Live data from Hacker News

Search: .lenght - Github

github.com

61–70 of 106 posts

Re: Search: .lenght - Github

#61
post #57
post #46

Earlier quoted context omitted.

Perhaps it would be more productive to advocate the use of local pre-commit hooks. Git makes it very easy to configure validation locally long before anything gets sent to Github. Would be nice if Github provided better documentation and a selection of validation templates to include in new projects. This would better leverage the power of Git and its distributed nature than a bot running on Github.

I'll look for more on this, but if you had something you would recommend as a tutorial, I'd appreciate it.

Didn't have a specific example in mind; there is definitely opportunity for Github to help with education and adoption.

For some reference material check out:

  http://book.git-scm.com/5_git_hooks.html
  http://progit.org/book/ch7-3.html
And a couple simple examples:

  http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes
  https://github.com/ReekenX/git-php-syntax-checker

Re: Search: .lenght - Github

#62
post #45
post #26

Earlier quoted context omitted.

I wrote that bot! https://github.com/Miserlou/WhitespaceBot Feel free to fork it to do whatever you want, that's why I made it.

Ah, aggressive trailing whitespace removal. That I can completely get behind. I've already got command-s bound to a custom macro that strips trailing whitespace in TextMate for myself and my co-workers; but this would be an even more inclusive solution.

Uhm. Why is this annoying, other than the fact that it shows up in your git commits?

Re: Search: .lenght - Github

#63
post #59

Earlier quoted context omitted.

C# I can understand being so low, since it's almost always written in Visual Studio or MonoDevelop (both of which provide autocompletion). But how is JavaScript the next lowest?

C# is also a compiled language, so you wouldn't be able to get anything to run with a typo like that hanging around. I find it surprising that there are so many commits making that mistake!

It shows up in comments and variable names frequently.

Re: Search: .lenght - Github

#64
post #62
post #45

Earlier quoted context omitted.

Ah, aggressive trailing whitespace removal. That I can completely get behind. I've already got command-s bound to a custom macro that strips trailing whitespace in TextMate for myself and my co-workers; but this would be an even more inclusive solution.

Uhm. Why is this annoying, other than the fact that it shows up in your git commits?

If you use Vim from the terminal to edit text (which I do), trailing whitespace shows up as big white blocks. It's slightly visually distracting, but it's really just an OCD thing.

Re: Search: .lenght - Github

#65
post #45
post #26

Earlier quoted context omitted.

I wrote that bot! https://github.com/Miserlou/WhitespaceBot Feel free to fork it to do whatever you want, that's why I made it.

Ah, aggressive trailing whitespace removal. That I can completely get behind. I've already got command-s bound to a custom macro that strips trailing whitespace in TextMate for myself and my co-workers; but this would be an even more inclusive solution.

Fantastic. If you use vim, you should have this in your .vimrc:

" Remove any trailing whitespace that is in the file

autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif

Re: Search: .lenght - Github

#67
post #45
post #26

Earlier quoted context omitted.

I wrote that bot! https://github.com/Miserlou/WhitespaceBot Feel free to fork it to do whatever you want, that's why I made it.

Ah, aggressive trailing whitespace removal. That I can completely get behind. I've already got command-s bound to a custom macro that strips trailing whitespace in TextMate for myself and my co-workers; but this would be an even more inclusive solution.

I prefer to have my editor strip that whenever I save a file without any manual action.

Re: Search: .lenght - Github

#68
post #51

Earlier quoted context omitted.

Yes it is, it would work fine as a variable . E.g. var lenght = 23; console.log(lenght); will not cause any troubles. And many of the results returned by the search are of this kind.

Were you replying to me? I explicitly said .lenght would return undefined. As in, a typo on the .length property.

Sorry -- I figure I misunderstood you.

Re: Search: .lenght - Github

#69
post #26

I remember seeing a Github bot a couple weeks ago that strips out whitespace and adds a .gitignore file to a repo (I also remember this really rubbing some people the wrong way). This search indicates that it would probably be useful to have a linter bot running on Github for all the popular languages. It would find syntax errors, common mispellings, and compilation issues, and then submit pull requests to fix the is…

I wrote that bot! https://github.com/Miserlou/WhitespaceBot Feel free to fork it to do whatever you want, that's why I made it.

Hey, some of us actually use trailing whitespace! :-)

I use it to create useful indentation guides in Komodo. If the whitespace is stripped away, the indentation guides have gaps where there's a blank line in an indented block.

Maybe Komodo could use a different method to decide where to draw the lines that didn't depend on trailing whitespace. It looks like Sublime Text 2 has a different approach for its indentation guides - maybe the Komodo guys should look at that. But in the meantime I'm using Komodo as it actually works today, so the whitespace on blank lines is important. Let me keep it, please? :-)

I wouldn't mind stripping out trailing whitespace on nonblank lines - that wouldn't affect my precious indentation guides.

But wait a minute, what about Markdown? Two spaces at the end of a line to get a
, right? Does the bot skip Markdown files?

Finally, for the folks who have automatic whitespace removal in their editor settings... Please be careful: With this setting, you'll be very likely to make a commit that includes both significant code changes and a mass of whitespace changes in the came commit.

Those kinds of changes should be separated: one commit for the code itself, and a separate commit for the whitespace with a comment like "Whitespace cleanup, no code changes."

This allows people who diff the revision history to diff with whitespace significant most of the time, the only exception being when reviewing a whitespace-only change.

(Edited for friendlier tone...)

Re: Search: .lenght - Github

#70

Earlier quoted context omitted.

Obviously you have never worked on a code base with 1000s of developers. If you edit almost every file then basically everyone needs to stop writing new code while the change is made. Otherwise the merges others have to do is going to be a disaster.

Honestly, do you really work on the same code base with "1000s of developers"? I find it really dubious.

Yes. It's called Microsoft.
Post reply on HN