Comments (17)
Hi @shahulhameedp,
Sorry for the trouble. In the past, we've seen segfaults caused by ESLint outputting an extremely high volume of issues on minified JS files. When you used the json
formatter (CODECLIMATE_DEBUG=1 codeclimate analyze -f json
), did you see issues output for any minified files? If so, we recommend excluding any minified files from analysis.
from codeclimate-eslint.
Hi @wfleming,
Thanks for replying.
I did remove the minified & libraries like this
exclude_paths:
- "spec/**/*"
- "test/**/*"
- "**/vendor/**/*"
- "public/**/*"
- "log/**/*"
- "tmp/**/*"
- "app/assets/node_modules/**/*"
- "app/assets/**/node_modules/**/*"
- "app/assets/lib/**/*"
- "app/assets/cssimg/**/*"
- "app/assets/images/**/*"
- "app/assets/login/partials/**/*"
- "app/assets/rover/css/*"
- "app/assets/shared/lib/*"
- "app/assets/rover/partials/**/*"
- "app/assets/rover/rvLocales/**/*"
- "app/assets/stylesheets/**/*"
- "app/assets/type/**/*"
- "app/assets/admin/adLocales/**/*"
- "app/assets/admin/css/*"
- "app/assets/admin/partials/**/*"
I didnt find any libraries being analyzed in a successful run. I have also added the .eslintignore to ensure that.
from codeclimate-eslint.
Adding more info.
[DEBUG] eslint:eslint-2 engine output: {"type":"issue","categories":["Style"],"check_name":"indent","description":"Expected indentation of 4 space characters but found 0.","content":{"body":"# enforce consistent indentation (indent)\n\n(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.\n\nThere are several common guidelines which require specific indentation of nested blocks and statements, like:\n\n```js\nfunction hello(indentSize, type) {\n if (indentSize === 4 && type !== 'tab') {\n console.log('Each next indentation will increase on 4 spaces');\n }\n}\n```\n\nThese are the most common scenarios recommended in different style guides:\n\n* Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix\n* Tabs: jQuery\n* Four spaces: Crockford\n\n## Rule Details\n\nThis rule enforces a consistent indentation style. The default style is `4 spaces`.\n\n## Options\n\nThis rule has a mixed option:\n\nFor example, for 2-space indentation:\n\n```json\n{\n \"indent\": [\"error\", 2]\n}\n```\n\nOr for tabbed indentation:\n\n```json\n{\n \"indent\": [\"error\", \"tab\"]\n}\n```\n\nExamples of **incorrect** code for this rule with the default options:\n\n```js\n/*eslint indent: \"error\"*/\n\nif (a) {\n b=c;\n function foo(d) {\n e=f;\n }\n}\n```\n\nExamples of **correct** code for this rule with the default options:\n\n```js\n/*eslint indent: \"error\"*/\n\nif (a) {\n b=c;\n function foo(d) {\n e=f;\n }\n}\n```\n\nThis rule has an object option:\n\n* `\"SwitchCase\"` (default: 0) enforces indentation level for `case` clauses in `switch` statements\n* `\"VariableDeclarator\"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations.\n\nLevel of indentation denotes the multiple of the indent specified. Example:\n\n* Indent of 4 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 8 spaces.\n* Indent of 2 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 4 spaces.\n* Indent of 2 spaces with `VariableDeclarator` set to `{\"var\": 2, \"let\": 2, \"const\": 3}` will indent the multi-line variable declarations with 4 spaces for `var` and `let`, 6 spaces for `const` statements.\n* Indent of tab with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 2 tabs.\n* Indent of 2 spaces with `SwitchCase` set to `0` will not indent `case` clauses with respect to `switch` statements.\n* Indent of 2 spaces with `SwitchCase` set to `2` will indent `case` clauses with 4 spaces with respect to `switch` statements.\n* Indent of tabs with `SwitchCase` set to `2` will indent `case` clauses with 2 tabs with respect to `switch` statements.\n\n### tab\n\nExamples of **incorrect** code for this rule with the `\"tab\"` option:\n\n```js\n/*eslint indent: [\"error\", \"tab\"]*/\n\nif (a) {\n b=c;\nfunction foo(d) {\n e=f;\n }\n}\n```\n\nExamples of **correct** code for this rule with the `\"tab\"` option:\n\n```js\n/*eslint indent: [\"error\", \"tab\"]*/\n\nif (a) {\n/*tab*/b=c;\n/*tab*/function foo(d) {\n/*tab*//*tab*/e=f;\n/*tab*/}\n}\n```\n\n### SwitchCase\n\nExamples of **incorrect** code for this rule with the `2, { \"SwitchCase\": 1 }` options:\n\n```js\n/*eslint indent: [\"error\", 2, { \"SwitchCase\": 1 }]*/\n\nswitch(a){\ncase \"a\":\n break;\ncase \"b\":\n break;\n}\n```\n\nExamples of **correct** code for this rule with the `2, { \"SwitchCase\": 1 }` option:\n\n```js\n/*eslint indent: [\"error\", 2, { \"SwitchCase\": 1 }]*/\n\nswitch(a){\n case \"a\":\n break;\n case \"b\":\n break;\n}\n```\n\n### VariableDeclarator\n\nExamples of **incorrect** code for this rule with the `2, { \"VariableDeclarator\": 1 }` options:\n\n```js\n/*eslint indent: [\"error\", 2, { \"VariableDeclarator\": 1 }]*/\n/*eslint-env es6*/\n\nvar a,\n b,\n c;\nlet a,\n b,\n c;\nconst a = 1,\n b = 2,\n c = 3;\
error: (JSON::ParserError) 757: unexpected token at '{"type":"issue","categories":["Style"],"check_name":"indent","description":"Expected indentation of 4 space characters but found 0.","content":{"body":"# enforce consistent indentation (indent)\n\n(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.\n\nThere are several common guidelines which require specific indentation of nested blocks and statements, like:\n\n```js\nfunction hello(indentSize, type) {\n if (indentSize === 4 && type !== 'tab') {\n console.log('Each next indentation will increase on 4 spaces');\n }\n}\n```\n\nThese are the most common scenarios recommended in different style guides:\n\n* Two spaces, not longer and no tabs: Google, npm, Node.js, Idiomatic, Felix\n* Tabs: jQuery\n* Four spaces: Crockford\n\n## Rule Details\n\nThis rule enforces a consistent indentation style. The default style is `4 spaces`.\n\n## Options\n\nThis rule has a mixed option:\n\nFor example, for 2-space indentation:\n\n```json\n{\n \"indent\": [\"error\", 2]\n}\n```\n\nOr for tabbed indentation:\n\n```json\n{\n \"indent\": [\"error\", \"tab\"]\n}\n```\n\nExamples of **incorrect** code for this rule with the default options:\n\n```js\n/*eslint indent: \"error\"*/\n\nif (a) {\n b=c;\n function foo(d) {\n e=f;\n }\n}\n```\n\nExamples of **correct** code for this rule with the default options:\n\n```js\n/*eslint indent: \"error\"*/\n\nif (a) {\n b=c;\n function foo(d) {\n e=f;\n }\n}\n```\n\nThis rule has an object option:\n\n* `\"SwitchCase\"` (default: 0) enforces indentation level for `case` clauses in `switch` statements\n* `\"VariableDeclarator\"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations.\n\nLevel of indentation denotes the multiple of the indent specified. Example:\n\n* Indent of 4 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 8 spaces.\n* Indent of 2 spaces with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 4 spaces.\n* Indent of 2 spaces with `VariableDeclarator` set to `{\"var\": 2, \"let\": 2, \"const\": 3}` will indent the multi-line variable declarations with 4 spaces for `var` and `let`, 6 spaces for `const` statements.\n* Indent of tab with `VariableDeclarator` set to `2` will indent the multi-line variable declarations with 2 tabs.\n* Indent of 2 spaces with `SwitchCase` set to `0` will not indent `case` clauses with respect to `switch` statements.\n* Indent of 2 spaces with `SwitchCase` set to `2` will indent `case` clauses with 4 spaces with respect to `switch` statements.\n* Indent of tabs with `SwitchCase` set to `2` will indent `case` clauses with 2 tabs with respect to `switch` statements.\n\n### tab\n\nExamples of **incorrect** code for this rule with the `\"tab\"` option:\n\n```js\n/*eslint indent: [\"error\", \"tab\"]*/\n\nif (a) {\n b=c;\nfunction foo(d) {\n e=f;\n }\n}\n```\n\nExamples of **correct** code for this rule with the `\"tab\"` option:\n\n```js\n/*eslint indent: [\"error\", \"tab\"]*/\n\nif (a) {\n/*tab*/b=c;\n/*tab*/function foo(d) {\n/*tab*//*tab*/e=f;\n/*tab*/}\n}\n```\n\n### SwitchCase\n\nExamples of **incorrect** code for this rule with the `2, { \"SwitchCase\": 1 }` options:\n\n```js\n/*eslint indent: [\"error\", 2, { \"SwitchCase\": 1 }]*/\n\nswitch(a){\ncase \"a\":\n break;\ncase \"b\":\n break;\n}\n```\n\nExamples of **correct** code for this rule with the `2, { \"SwitchCase\": 1 }` option:\n\n```js\n/*eslint indent: [\"error\", 2, { \"SwitchCase\": 1 }]*/\n\nswitch(a){\n case \"a\":\n break;\n case \"b\":\n break;\n}\n```\n\n### VariableDeclarator\n\nExamples of **incorrect** code for this rule with the `2, { \"VariableDeclarator\": 1 }` options:\n\n```js\n/*eslint indent: [\"error\", 2, { \"VariableDeclarator\": 1 }]*/\n/*eslint-env es6*/\n\nvar a,\n b,\n c;\nlet a,\n b,\n c;\nconst a = 1,\n b = 2,\n c = 3;\'
[DEBUG] backtrace: /usr/lib/ruby/gems/2.2.0/gems/json-1.8.3/lib/json/common.rb:155:in `parse'
/usr/lib/ruby/gems/2.2.0/gems/json-1.8.3/lib/json/common.rb:155:in `parse'
/usr/src/app/lib/cc/analyzer/issue.rb:50:in `parsed_output'
/usr/src/app/lib/cc/analyzer/issue.rb:21:in `as_json'
/usr/lib/ruby/gems/2.2.0/gems/activesupport-4.2.6/lib/active_support/json/encoding.rb:35:in `encode'
/usr/lib/ruby/gems/2.2.0/gems/activesupport-4.2.6/lib/active_support/json/encoding.rb:22:in `encode'
/usr/lib/ruby/gems/2.2.0/gems/activesupport-4.2.6/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
/usr/src/app/lib/cc/analyzer/engine_output.rb:5:in `to_json'
/usr/src/app/lib/cc/analyzer/engine.rb:46:in `block in run'
/usr/src/app/lib/cc/analyzer/container.rb:115:in `call'
/usr/src/app/lib/cc/analyzer/container.rb:115:in `block (2 levels) in read_stdout'
/usr/src/app/lib/cc/analyzer/container.rb:112:in `each_line'
/usr/src/app/lib/cc/analyzer/container.rb:112:in `block in read_stdout'
Starting analysis
cc @wfleming
from codeclimate-eslint.
Sorry for my delayed reply, @shahulhameedp. I haven't been able to reproduce this behavior locally, so haven't been able to determine any potential causes. Is there any chance the project you're seeing this on is open source so we can reproduce this?
from codeclimate-eslint.
@shahulhameedp thanks for the report. I'm currently looking into this issue and will report back as soon as we have an update.
@wfleming Found a reproducible case here: https://github.com/ABaldwinHunter/strider/tree/abh-test
from codeclimate-eslint.
@shahulhameedp: For the open source project I linked to, excluding a few third party directories fixed the issue, seconding @wfleming's explanation from earlier.
Alack I see you've already excluded several likely suspects.
While we continue to investigate this issue, here are some steps you could take locally to identify any directories or files that might happen to be hitting this weak point:
-
Run
codeclimate analyze -e eslint -f json >> results.json
to see the issue output produced and where the process dies. (The
json
formatter outputs issues as it goes so you can see progress.) -
Experiment with some additional excludes. You could also run
eslint
on targeted directories to see which one blows up:codeclimate analyze -e eslint app/assets
Thanks for your feedback. Let me know how it goes!
from codeclimate-eslint.
Hi @ABaldwinHunter,
Thank you for responding.
Regarding your first point, I ran the same and I got the same error (error: (CC::Analyzer::Engine::EngineFailure) engine eslint:eslint-2 failed with status 139 and stderr
) and I've sent the log to your colleague named Jenna Smith.
I also tried against the HTML format by running the following command CODECLIMATE_DEBUG=1 codeclimate analyze -e eslint -f html
and that also resulted in the same error.
Regarding your second point,
Yes, I tried for smaller directories and it was successful but as soon as I ran against a directory having 20 files or more it breaks.
But if I run eslint without codeclimate for our entire codebase it is completing successfully.
Thanks,
Shahul
from codeclimate-eslint.
Hey @shahulhameedp,
Thanks for all your time and extra help with tracking this down.
I see you mentioned that you sent the log for a command you ran locally to me, but I double checked and it doesn't look like I've received anything from you. Do you want to try sending that to me again?
Also, would you be able to run CODECLIMATE_DEBUG=1 codeclimate analyze -f json
again locally and send me the full output you see? I double checked on the thread above and it looks like you may have only sent part of the output. Having the full output would be super helpful.
Thanks Shahul. I'll be ready to help out further once I hear back from you.
from codeclimate-eslint.
Hi @leftees I have emailed you the full output on August 3. Please let me know if you need me to resend it.
from codeclimate-eslint.
Hi @leftees
just for your information, @jon-stayntouch is my colleague and I was in that mail loop :)
Thanks,
Shahul
from codeclimate-eslint.
Hey @shahulhameedp @jon-stayntouch -
I'm sorry -- you're right. I do see you attached it in your response on 8/3.
I just took a look at it, and it looks like the process dies when trying to analyze your app/assets/admin/controllers/adAddCampaignCtrl.js
file.
By any chance would you be able to share that file with us? If that's ok with you, I'd recommend sending it to me in the thread that we have going via email for privacy/security reasons, as this is an open source thread.
from codeclimate-eslint.
@shahulhameedp Thanks for all of your patience here.
Happy to report that we just introduced a change to the eslint-2 engine channel to skip files that appear minified:
#114
We suspect that this change may permit your analysis to run.
You should see a description of the skipped files in the ESLint tab on the build page:
Could you try running a new analysis with eslint-2 on .com or CLI ( CODECLIMATE_DEBUG=1 codeclimate analyze -e eslint
) and let us know the result?
from codeclimate-eslint.
@ABaldwinHunter @leftees I responded over the email, please review
from codeclimate-eslint.
@gordondiggs do you believe this issue has been resolved? Do you think #99 is a duplicate and could also be closed?
from codeclimate-eslint.
@pbrisbin Yep. I know @shahulhameedp ran into another issue that @leftees is helping with separately, but this specific issue should be resolved
from codeclimate-eslint.
Thanks. I'm going to go ahead and close then.
from codeclimate-eslint.
👍 thanks
from codeclimate-eslint.
Related Issues (20)
- Cloud version not finding typescript types
- ESLint 7.8.1 doesn't exist HOT 1
- FEATURE REQUEST: please merge #537 pull request
- Add support for plugins for eslint-7 channel HOT 6
- Please merge the six Dependabot pull requests into the main branch
- How to Enable Module Resolution
- `eslint-plugin-graphql` not supported HOT 2
- eslint-8 channel? HOT 3
- Environment key "es2021" is unknown HOT 2
- Parsing error: Invalid ecmaVersion.
- Can we update the channels, please?
- Is it possible to disable Eslint check?
- Error on Analysis Configuration .codeclimate.yml
- How to extend custom config? HOT 1
- feature request: extend custom config
- Upgrade eslint-7?
- Add support for plugins for eslint-8 channel HOT 6
- Add eslint-plugin-astro to eslint-8 plugin list
- Add eslint-plugin-svelte to eslint-8
- `MODULE_NOT_FOUND` error while using prettier plugins
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeclimate-eslint.