Coder Social home page Coder Social logo

coding-standards's Introduction

Ortus Coding Style Guides

This repository includes all of the Ortus coding style guides, linter and formatting configurations. Read, collaborate and enjoy.

Guides

Linters

Formatters

IDE Automatic Coding Standards

We also provide ways to apply our formatting rules automatically via modern IDEs.

CommandBox Formatting

Start off by installing the cfformat CommandBox package: box install commandbox-cfformat. Then in the root of your application if you have a box.json open it. If you don't, then initialize your application as a CommandBox package: box init. Then open the file and look for a scripts section, if you don't have one, then add it. We will create three scripts to format your source code:

  • format : Format all the files/directories you want
  • format:watch : Start a watcher for all the files/directories you want and if a save is detected, automatically format the changed files.
  • format:check : Verifies if the watched files/directories adhere to your style guides.
scripts : {
    "format" : "cfformat run handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc --overwrite",
    "format:watch" : "cfformat watch handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc ./.cfformat.json",
    "format:check" : "cfformat check handlers/,interceptors/,models/,test-harness/tests/specs,ModuleConfig.cfc",
}

Then you can run a watcher: box run-script format:watch and everytime you save a change in the files being watched, the formatter will automatically format the CFML code.

VSCode ESLint

We are using ESLint as our standards for formatting and linting for JavaScript and Vue files. You can follow this guide to setup your VSCode editor for formatting and linting: Setup VSCode

Sublime

If you use Sublime as your IDE, you can install the CFML package and use the built-in formatter to help you format CFML files according to our standards. Just open the Format Settings and paste in the Sublime Settings contents. Then you can use the shortcut for it according to OS to execute it. You can read it here: https://github.com/jcberquist/sublimetext-cfml#code-formatting

sublime settings

The CFML Format operation is a manual command in Sublime by default. To make it automatic, install the "Hooks" (https://packagecontrol.io/packages/Hooks) plugin for Sublime and then add the following hook to your Syntax specific settings for CFML. To get to the Syntax specific settings, open a CFM or CFC file in Sublime then select the menu item Sublime Text > Preferences > Syntax - Specific Settings

// These settings override both User and Default settings for the cfml
syntax
{
 "on_pre_save_language": [
     {
         "command": "cfml_format",
         "args": {
        "current_method": false
}, }
] }

Copyright Ortus Solutions Corp

If otherwise noted, this content is property of Ortus Solutions, Corp.

Soli Deo Gloria

coding-standards's People

Contributors

lmajano avatar dh4u avatar elpete avatar michaelborn avatar abilioposada avatar xdecock avatar gknight593 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.