Contributing to CFWheels

Here are the rules of the road for contributing code to the project. Let's follow this process so that we don't duplicate effort and so the code base is easy to maintain over the long haul.

Repository

The official Git repository for Wheels is located at our GitHub repository.

Anyone may fork the cfwheels repository, make changes, and submit a pull request.

Core Team Has Write Access

To make sure that we don't have too many chefs in the kitchen, we will be limiting direct commit access to a core team of developers.

At this time, the core team consists of these developers:

This does not restrict you from being able to contribute. See "Process for Implementing Changes to the Code" below for instructions on volunteering. With enough dedication, you can earn a seat on the core team as well!

Process for Implementing Changes to the Code

Here's the process that we'd like for you to follow. This process is in place mainly to encourage everyone to communicate openly. This gives us the opportunity to have a great peer-review process, which will result in quality. Who doesn't like quality?

  1. Open an issue in the issue tracker, outlining the changes or additions that you would like to make.
  2. A member of the core team will review your submission and leave feedback if necessary.
  3. Once the core team member is satisfied with the scope of the issue, they will indicate so in a comment to the issue. This is your green light to start working. Get to coding, grasshopper!
  4. Need help or running across any issues while coding? Run it by the Google Group. They all have opinions and love to let you know all about them. :smile: When you submit a question on Google Group about one of these guides, please put the name of the guide as part of the subject.
  5. When you have implemented your enhancement or change, use your Git repository to create a pull request with your changes.
    • You should annotate your commits with the issue number as #55 if the code issue is 55
  6. A core team will review it and post any necessary feedback in the issue tracker.
  7. Once everything is resolved, a core team member will pull your commit into the Git repository.
  8. If needed, open an issue in the issue tracker to have the additions and changes in your revision documented. You may claim the issue if you'd like to do this, but it's entirely your choice.

Code Style

All framework code should use the guidelines at https://github.com/cfwheels/cfwheels/wiki/Code-Style-Guide. This will make things more readable and will keep everyone on the same page. If you're working on code and notice any violations of the official style, feel free to correct it!

Additionally, we recommend that any applications written using the CFWheels framework follow the same style. This is optional, of course, but still strongly recommended.

Supported CFML Engines

All code for CFWheels should be written for use with Adobe ColdFusion 11 upwards, and Lucee 4.x/5.x.

Naming Conventions

To stay true to our ColdFusion and Java roots, all names must be camelCase. In some cases, such as internal CFML functions, the first letter should be capitalized as well. Refer to these examples.

Code ElementExamplesDescription
CFC NamesMyCfc.cfc, BlogEntry.cfcCapitalizedCamelCase
Variable NamesmyVariable, storyIdcamelCase
UDF NamesmyFunction()camelCase
Built-in CF Variablesresult.recordCount, cfhttp.fileContentcamelCase
Built-in CF FunctionsIsNumeric(), Trim()CapitalizedCamelCase
Scoped Variablesapplication.myVariable, session.userIdlowercase.camelCase
CGI Variablescgi.remote_addr, cgi.server_namecgi.lowercase_underscored_name

CFC Conventions

Local variables

Since moving to CFWheels 2.x, the old loc scope has now been deprecated and you should use the function local scope.

// This is just for illustration. It's obviously a silly function.
function returnArrayLengthInWords(required array someArray){
  local.rv="Unknown";
    if(arrayLen(arguments.someArray) > 50){
    local.rv="Pretty Long!";
  } 
    if(arrayLen(arguments.someArray) > 100){
    local.rv="Very Long!";
  } 
  return local.rv;
}
CFC Methods

All CFC methods should be made public. If a method is meant for internal use only and shouldn't be included in the API, then prefix it with a dollar sign $. An example would be $query().