cpplint | ||
docguide | ||
include | ||
c-style.el | ||
cppguide.html | ||
cppguide.xml | ||
eclipse-cpp-style.xml | ||
eclipse-java-style.xml | ||
intellij-java-style.xml | ||
javaguide.css | ||
javaguide.html | ||
javaguidelink.png | ||
jsoncstyleguide_example_01.png | ||
jsoncstyleguide_example_02.png | ||
jsoncstyleguide.html | ||
jsoncstyleguide.xml | ||
lispguide.xml | ||
objcguide.md | ||
objcguide.xml | ||
pyguide.html | ||
pyguide.md | ||
python_style.vim | ||
README.md | ||
Rguide.xml | ||
shell.xml | ||
styleguide.css | ||
styleguide.xsl | ||
vimscriptfull.xml | ||
vimscriptguide.xml | ||
xmlstyle.html |
Move Digital Style Guides
Every organization must have its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that organization. It is much easier to understand a large codebase when all the code in it is in a consistent style. There is also benefit to be had from that style guide matching (or closely following) a more widely used style guide.
“Style” covers a lot of ground, from “use camelCase for variable names” to “never use global variables” to “never use exceptions.” This project (AmanaAdvisors/styleguide) links to the style guidelines we use for Move Digital code. Much of it is borrowed wholesale from the Google style guide (see the "arbitrary" and "matching"/"following" above), with tiny, specific changes to better match the prevailing status quo at the time of adoption.
The core and main focus of this project is the Java Style Guide, as we are primarily a Java shop. For that end it provides Eclipse and IntelliJ code style profiles, which imported into your IDE of choice, allow you to quickly format code (and more easily write properly formatted code to begin with).
This project also holds style guides for the C++, Objective-C, Python, R, Shell Script, Common Lisp, and Vimscript; as well as cpplint, a tool to assist with style guide compliance, and c-style.el, an Emacs settings file for C/C++. If you find yourself writing code in one of these languages, it is arguably better to begin with some rules in place.
The notable absentees from this list are JavaScript/HTML/CSS. The style guides for these are covered in the UX team's Coding Conventions and Team Best Practices document.
If your project requires that you create a new XML document format, the XML Document Format Style Guide may be helpful. In addition to actual style rules, it also contains advice on designing your own vs. adapting an existing format, on XML instance document formatting, and on elements vs. attributes.
The following style guides live outside of this project: Go Code Review Comments and Effective Dart.
The style guides in this project are licensed under the CC-By 3.0 License, which encourages you to share these documents. See https://creativecommons.org/licenses/by/3.0/ for more details.
Importing the Java code style profile into Intellij IDEA
- Download intellij-java-style.xml to your local disk.
- In IDEA menu, follow Intellij IDEA -> Preferences -> (In opened window expand) Editor -> Code Style -> Java -> Find "Scheme" label and next to the value of it find the gear icon.
- Click on the icon -> Import Scheme -> Intellij Idea Code Style XML -> Find and select intellij-java-style.xml on the local disk.
Importing the Java code style profile into Eclipse
- Download eclipse-java-style.xml to your local disk.
- In the Eclipse menu, click on Window -> Preferences, then navigate to Java -> Code Style -> Formatter.
- In the right panel click on Import..., select intellij-java-style.xml from the local disk and click "OK".
- Back in the Preferences dialog, click Apply and Close.