Skip to content
Permalink
Browse files
chore(formatting): Use cfformat for automatic formatting
Use CFFormat to automatically format the codebase.  It also checks
on CI that the formatting is being followed.
  • Loading branch information
elpete committed Jan 25, 2020
1 parent 6b79241 commit 119e434b307a2cc2323b857a214c20842cafbbd4
Showing 40 changed files with 5,732 additions and 4,988 deletions.
@@ -0,0 +1,58 @@
{
"alignment.consecutive.assignments":false,
"alignment.consecutive.params":false,
"alignment.consecutive.properties":false,
"array.empty_padding":false,
"array.multiline.element_count":4,
"array.multiline.leading_comma":false,
"array.multiline.leading_comma.padding":true,
"array.multiline.min_length":40,
"array.padding":true,
"binary_operators.padding":true,
"brackets.padding":true,
"comment.asterisks":"align",
"for_loop_semicolons.padding":true,
"function_anonymous.empty_padding":false,
"function_anonymous.group_to_block_spacing":"spaced",
"function_anonymous.multiline.element_count":4,
"function_anonymous.multiline.leading_comma":false,
"function_anonymous.multiline.leading_comma.padding":true,
"function_anonymous.multiline.min_length":40,
"function_anonymous.padding":true,
"function_call.casing.builtin":"cfdocs",
"function_call.casing.userdefined":"camel",
"function_call.empty_padding":false,
"function_call.multiline.element_count":4,
"function_call.multiline.leading_comma":false,
"function_call.multiline.leading_comma.padding":true,
"function_call.multiline.min_length":40,
"function_call.padding":true,
"function_declaration.empty_padding":false,
"function_declaration.group_to_block_spacing":"spaced",
"function_declaration.multiline.element_count":4,
"function_declaration.multiline.leading_comma":false,
"function_declaration.multiline.leading_comma.padding":true,
"function_declaration.multiline.min_length":40,
"function_declaration.padding":true,
"indent_size":4,
"keywords.block_to_keyword_spacing":"spaced",
"keywords.empty_group_spacing":false,
"keywords.group_to_block_spacing":"spaced",
"keywords.padding_inside_group":true,
"keywords.spacing_to_block":"spaced",
"keywords.spacing_to_group":true,
"max_columns":120,
"method_call.chain.multiline":3,
"newline":"os",
"parentheses.padding":true,
"strings.attributes.quote":"double",
"strings.quote":"double",
"struct.empty_padding":false,
"struct.multiline.element_count":4,
"struct.multiline.leading_comma":false,
"struct.multiline.leading_comma.padding":true,
"struct.multiline.min_length":40,
"struct.padding":true,
"struct.separator":": ",
"tab_indent":false
}
@@ -18,11 +18,13 @@ before_install:
- sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a /etc/apt/sources.list.d/commandbox.list
install:
- sudo apt-get update && sudo apt-get --assume-yes install commandbox jq rsync
- box install commandbox-cfformat
- box install
before_script:
- box server start name=qb cfengine=$ENGINE port=8500
script:
- box testbox run runner='http://127.0.0.1:8500/tests/runner.cfm'
- box run-script format:check
after_success:
- box install commandbox-docbox,commandbox-semantic-release
- box config set endpoints.forgebox.APIToken=${FORGEBOX_TOKEN}
@@ -8,7 +8,9 @@
"scripts":{
"generateAPIDocs":"rm .tmp --recurse --force && docbox generate mapping=qb excludes=test|ModuleConfig strategy-outputDir=.tmp/apidocs strategy-projectTitle=qb",
"commitAPIDocs":"run-script generateAPIDocs && !git add docs/apidocs/* && !git commit -m 'Updated API Docs'",
"postVersion":"package set location='coldbox-modules/qb#v`package version`'"
"postVersion":"package set location='coldbox-modules/qb#v`package version`'",
"format": "cfformat run models/**/*.cfc,tests/resources/**/*.cfc,tests/specs/**/*.cfc --overwrite",
"format:check": "cfformat check models/**/*.cfc,tests/resources/**/*.cfc,tests/specs/**/*.cfc"
},
"repository":{
"type":"git",
@@ -4,9 +4,9 @@ component singleton {
property name="grammar";

function autoDiscoverGrammar() {
cfdbinfo( type = "Version", name = "local.dbInfo" );
cfdbinfo(type="Version", name="local.dbInfo");

switch( dbInfo.DATABASE_PRODUCTNAME ) {
switch ( dbInfo.DATABASE_PRODUCTNAME ) {
case "MySQL":
return wirebox.getInstance( "MySQLGrammar@qb" );
case "PostgreSQL":
@@ -21,9 +21,10 @@ component singleton {
}

function onMissingMethod( missingMethodName, missingMethodArguments ) {
if ( ! structKeyExists( variables, "grammar" ) ) {
if ( !structKeyExists( variables, "grammar" ) ) {
variables.grammar = autoDiscoverGrammar();
}
return invoke( variables.grammar, missingMethodName, missingMethodArguments );
}

}

0 comments on commit 119e434

Please sign in to comment.