17 May 2012 sjanes71   » (Journeyer)

CoffeeLint Configuration for Tab-Indentation CoffeeScript Authors

I’m falling into “use a tab” camp for source-formatting and counting tabs as indentation. If you want to configure your source editor to make those tabs appear as 2, 3, 4 or even 8 spaces wide, go ahead. For me, I think of them as logical mark-up for your “intent” of “identation.”  Any tab to me means one level of indentation.

Here’s a CoffeeLint.json configuration for that kind of work with CoffeeScript:

{
 "no_tabs" : {
 "level" : "ignore"
 },
"no_trailing_whitespace" : {
 "level" : "error"
 },
"max_line_length" : {
 "value": 80,
 "level" : "error"
 },
"camel_case_classes" : {
 "level" : "error"
 },
"indentation" : {
 "value" : 1,
 "level" : "error"
 },
"no_implicit_braces" : {
 "level" : "ignore"
 },
"no_trailing_semicolons" : {
 "level" : "error"
 },
"no_plusplus" : {
 "level" : "ignore"
 },
"no_throwing_strings" : {
 "level" : "error"
 },
"cyclomatic_complexity" : {
 "value" : 11,
 "level" : "ignore"
 },
"line_endings" : {
 "value" : "unix",
 "level" : "ignore"
 },
"no_implicit_parens" : {
 "level" : "ignore"
 }
}

Yes, I realize that this JSON file itself is not tab-indented.


Syndicated 2012-04-17 01:55:12 from sj4̄nz

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!