Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Running with -w (warnings) generates output #160

Closed
tobireif opened this Issue · 4 comments

4 participants

@tobireif

/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/tree/node.rb:72:
warning: method redefined; discarding old children=
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/script/parser.rb:233:
warning: literal in condition
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/script/parser.rb:246:
warning: literal in condition
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass.rb:30:
warning: redefine compile
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass.rb:54:
warning: redefine compile_file
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/environment.rb:126: warning:
instance variable @functions not initialized
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/environment.rb:38: warning:
instance variable @options not initialized
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/environment.rb:126: warning:
instance variable @functions not initialized
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/environment.rb:38: warning:
instance variable @options not initialized
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/environment.rb:126: warning:
instance variable @functions not initialized
/Library/Ruby/Gems/1.8/gems/sass-3.1.7/lib/sass/../sass/environment.rb:38: warning:
instance variable @options not initialized
[...]

(My code is not very relevant I guess.)

Probably best to make sure to always run with -w during dev and testing.

@chriseppstein

Our tests make sure the project works. -w forces a non-idiomatic, non-standard coding style.

@tobireif

Sure, I'm aware of the function of the tests, and I don't doubt they can make sure that the project works. -w isn't necessary for that.

-w is intended to offer hints for improving the code. If you think that these warnings are bogus, then perhaps the Ruby core people would be interested in why.

If you see no action required, feel free to forget about this ticket.

@thedarkone

I'm with chriseppstein on this one. Ruby warnings are sometimes really annoying and force stupid code structure.

@nex3
Owner

For reference, of these warnings, only the first is something we might actually want to consider changing. The "literal in condition" warnings come from doing something like !:flagname, which is a useful way of passing boolean flags in a readable manner. The "redefine" warnings come from double-loading sass.rb, which is expected and useful for providing a single entry point to the project. The instance variable warnings come from assuming that undefined instance variables evaluate to nil, which allows us to avoid messy and unnecessary initialization.

@tenderlove tenderlove referenced this issue
Closed

Fix Warnings #695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.