# $Id$ This file contains some brief instructions on contributing to the Metasploit Framework. Code Style ========== In order to maintain consistency and readability, we ask that you adhere to the following style guidelines: - Hard tabs, not spaces - Try to keep your lines under 100 columns (assuming four-space tabs) - do; end instead of {} for a block - Always use str[0,1] instead of str[0] (This avoids a known ruby 1.8/1.9 incompatibility.) - Method names should always be lower_case and words separated by "_" - Variable names should be lower case with words separated by "_" - Don't depend on any external gems or libraries without talking to egypt to resolve packaging and licensing issues You can use the the "./tools/msftidy.rb" script to do some rudimentary checking for various violations. Code No-Nos =========== 1. Don't print to standard output. Doing so means that users of interfaces other than msfconsole, such as msfrpc and msfgui, won't see your output. You can use print_line to accomplish the same thing as puts. 2. Don't read from from standard input, doing so will make your code lock up the entire module when called from other interfaces. If you need user input, you can either register an option or expose an interactve session type specific for the type of exploit. 3. Don't use "sleep". It has been known to cause issues with multi-threaded programs on various platforms. Instead, we use "select(nil, nil, nil,