tkqubo / codeclimate-tslint

Code Climate TSLint-Engine
40 stars 20 forks source link

FatalError: Failed to load (Could not find custom rule directory) #47

Open larkinscott opened 6 years ago

larkinscott commented 6 years ago

Hey @tkqubo! I tacked on some comments to issue https://github.com/tkqubo/codeclimate-tslint/issues/46, but I think this may actually be something different happening, so thought it might be test to open a new issue:

https://github.com/angular/material2/blob/master/tslint.json https://github.com/ReactiveX/rxjs/blob/master/tslint.json

When running the Code Climate TSLint engine against these repos, I get the following issues. I also tried running an image of the most recent commit, but hit the same error.

error: (CC::CLI::Analyze::EngineFailure) engine mostrecenttslint failed with status 1 and stderr 
/usr/src/app/node_modules/tslint/lib/configuration.js:55
        throw new error_1.FatalError("Failed to load " + configPath + ": " + error.message, error);
        ^

FatalError: Failed to load /tmp/codeclimate-tslint/e3efb27bd4ef59dc8880b69ae3fcc95d1e7a3d223796ac55113d17d06d6a0f47.json: Could not find custom rule directory: ./tools/tslint-rules/
    at FatalError.Error (native)
    at new FatalError (/usr/src/app/node_modules/tslint/lib/error.js:27:28)
    at Object.findConfiguration (/usr/src/app/node_modules/tslint/lib/configuration.js:55:15)
    at new TsLinter (/usr/src/app/dist/tsLinter.js:33:57)
    at Object.<anonymous> (/usr/src/app/dist/index.js:28:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/src/app/bin/analyze:2:1)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
D, [2018-03-20T19:10:11.600730 #1] DEBUG -- : backtrace: /usr/src/app/lib/cc/analyzer/raising_container_listener.rb:23:in `finished'
    /usr/src/app/lib/cc/analyzer/composite_container_listener.rb:13:in `block in finished'
    /usr/src/app/lib/cc/analyzer/composite_container_listener.rb:13:in `each'
    /usr/src/app/lib/cc/analyzer/composite_container_listener.rb:13:in `finished'
    /usr/src/app/lib/cc/analyzer/bridge.rb:52:in `block (2 levels) in run'
    /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:63:in `with_spinner'
    /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:41:in `block in engine_running'
    /usr/src/app/lib/cc/analyzer/formatters/formatter.rb:31:in `engine_running'
    /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:40:in `engine_running'
    /usr/src/app/lib/cc/analyzer/bridge.rb:37:in `block in run'
    /usr/src/app/lib/cc/analyzer/bridge.rb:34:in `each'
    /usr/src/app/lib/cc/analyzer/bridge.rb:34:in `run'
    /usr/src/app/lib/cc/cli/analyze.rb:36:in `run'
    /usr/src/app/lib/cc/cli/command.rb:73:in `execute'
    /usr/src/app/lib/cc/cli/runner.rb:25:in `run'
    /usr/src/app/lib/cc/cli/runner.rb:9:in `run'
    /usr/src/app/bin/codeclimate:12:in `<main>'
error: (CC::CLI::Analyze::EngineFailure) engine mostrecenttslint failed with status 1 and stderr 
/usr/src/app/node_modules/tslint/lib/configuration.js:55
        throw new error_1.FatalError("Failed to load " + configPath + ": " + error.message, error);
        ^

FatalError: Failed to load /tmp/codeclimate-tslint/4ed20eb8fec338eb729135346f820d039a8c9fc7d4d98059b09198bd74a66999.json: Could not find custom rule directory: tslint-no-unused-expression-chai
    at FatalError.Error (native)
    at new FatalError (/usr/src/app/node_modules/tslint/lib/error.js:27:28)
    at Object.findConfiguration (/usr/src/app/node_modules/tslint/lib/configuration.js:55:15)
    at new TsLinter (/usr/src/app/dist/tsLinter.js:33:57)
    at Object.<anonymous> (/usr/src/app/dist/index.js:28:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/src/app/bin/analyze:2:1)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
D, [2018-03-20T19:11:23.699189 #1] DEBUG -- : backtrace: /usr/src/app/lib/cc/analyzer/raising_container_listener.rb:23:in `finished'
    /usr/src/app/lib/cc/analyzer/composite_container_listener.rb:13:in `block in finished'
    /usr/src/app/lib/cc/analyzer/composite_container_listener.rb:13:in `each'
    /usr/src/app/lib/cc/analyzer/composite_container_listener.rb:13:in `finished'
    /usr/src/app/lib/cc/analyzer/bridge.rb:52:in `block (2 levels) in run'
    /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:63:in `with_spinner'
    /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:41:in `block in engine_running'
    /usr/src/app/lib/cc/analyzer/formatters/formatter.rb:31:in `engine_running'
    /usr/src/app/lib/cc/analyzer/formatters/plain_text_formatter.rb:40:in `engine_running'
    /usr/src/app/lib/cc/analyzer/bridge.rb:37:in `block in run'
    /usr/src/app/lib/cc/analyzer/bridge.rb:34:in `each'
    /usr/src/app/lib/cc/analyzer/bridge.rb:34:in `run'
    /usr/src/app/lib/cc/cli/analyze.rb:36:in `run'
    /usr/src/app/lib/cc/cli/command.rb:73:in `execute'
    /usr/src/app/lib/cc/cli/runner.rb:25:in `run'
    /usr/src/app/lib/cc/cli/runner.rb:9:in `run'
    /usr/src/app/bin/codeclimate:12:in `<main>'
borisonr commented 6 years ago

I get this error as well in a private repo, where we use the rulesDirectory property in the tslint config and it prevents us from enabling tslint in code climate. If I remove the property from the config, tslint works fine in code climate.

DanTup commented 6 years ago

Same issue here. Support told me it might be for security reasons that they won't run custom code, however it would be preferable to just not run my custom rules than to bring the whole build down. The custom rule is really there for the IDE and CI builds to fail - if it has passed them, having it skipped on CodeClimate would be fine by me.