Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Running with -w (warnings) generates output #160

Closed
tobireif opened this Issue Aug 30, 2011 · 4 comments

Comments

Projects
None yet
4 participants

/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.

Owner

chriseppstein commented Aug 30, 2011

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

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.

Contributor

thedarkone commented Aug 30, 2011

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

Contributor

nex3 commented Aug 31, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment