Having some trouble with commandbox-actions runnin...
# box-products
b
Having some trouble with commandbox-actions running cfformat check and failing on all files where, locally, all files pass. I've confirmed that the action is in the right directory and using the correct .cfformat.json rules but cannot figure out why they all fail in the action. The entire workflow is just this...
Copy code
on: [push]
jobs:
  build:
    name: CFML Format and lint checks
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3
      - name: Linter/Format Checks
        uses: Ortus-Solutions/commandbox-action@v1.0.3
        with:
          cmd: cd /github/workspace/app && run-script format:check && run-script linter
My package script for format:check is...
"format:check":"cfformat check handlers,includes,interceptors,models,tests/**.cfc,ModuleConfig.cfc",
The cflint check works fine in the action
actions is running CommandBox 5.8.0+00695 (don't tell Brad but that is also the version I am running locally)
b
What's the build output?
I would assume some of your source files are not formatted correctly
The check command returns a failing exit code if the files aren't formatted.
b
The output is the expected result when files are NOT formatted The following files do not match the cfformat rules: <list of ALL files> Please format the files using the
--overwrite
flag. ERROR (5.8.0+00695) Package script returned failing exit code (1) Failing script: format:check
again though, the same cfformat command running locally using the same .cfformat.json file says the fiels are all already formatted correctly.
(and same commandbox version)
got it to output the expected formatted results of one of the files to compare and it is complaining about some spacing that it doesn't complain about locally (again with the same .cfformat.json rules)
Copy code
"loadPaths"        : [
			"#expandPath( ".\modules_app\fileService\lib" )#",
			"#expandPath( ".\modules_app\parsingService\lib" )#"
		],
The GH action cfformat check doesn't like the spacing after "LoadPaths" (and it shouldn't really...) and locally it doesn't complain about it. Trying to figure out the cfformat versions now.
actually, it SHOULDN'T be complaining about it since it lines up with a few more keys (not that it matters right now... just trying to figure out why there are different results)
Copy code
this["javaSettings"] = {
		"loadPaths"        : [
			"#expandPath( ".\modules_app\fileService\lib" )#",
			"#expandPath( ".\modules_app\parsingService\lib" )#"
		],
		"loadCFMLClassPath": true,
		"reloadOnChange"   : true,
		"watchInterval"    : 100,
		"watchExtensions"  : "jar,class"
	};
ran install for cfformat 0.19.0 to match my local version and STILL a different result. Windows vs Ubuntu maybe ¯\_(ツ)_/¯ I'll have to test my stuff in ubuntu I guess.
check is failing on ubuntu for me so must be a windows/ubuntu difference... which is gonna suck since these guys are writing everything on Windows.
Ubuntu cfformat wants to convert all indent tabs to spaces... that's (mostly) why it's complaining on all files
b
Yeah, I would expect this is a whitespace issue.
Regardless, the question was really about cfformat and not CommandBox. I didn't write and don't maintain cfformat. You can reach out to John Berquist on the Github issue tracker for cfformat questions (or ping him here)
👍 1
If you want to be loosey goosey on whitespace, you can prolly just remove that rule
b
yeah, ubuntu seems to be ignoring the tab_indent: true setting. I was thinking about just turning it off and reformatting everything
thanks for looking with me