Skip to content

Remove cppcheck and vera++ from prerequisites #872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

akosthekiss
Copy link
Member

Rely on platform-provided versions. Thus, no need to download and
build them, neither to wrap them with shell scripts. CMake and
precommit updated to call the new tools.

PS: On my Ubuntu 14.04.3, cppcheck has version 1.61, while prereq
version was 1.69. The older version reports and fails on a strange
style issue in ecma/builtin-objects/ecma-builtin-helpers.cpp, for
which the only solution found was to suppress cppcheck errors with
variableScope id.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu

resolves #844

@akosthekiss akosthekiss added enhancement An improvement infrastructure Related to GH Actions or the tested targets style Related to coding style labels Feb 10, 2016
@@ -1,3 +1,4 @@
operatorEqVarError
noConstructor
duplicateExpression
variableScope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure suppressing all of the variable scope expressions is a good idea? What is the style issue in ecma/builtin-objects/ecma-builtin-helpers.cpp?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the ID cppcheck reported for the error when running with --xml. I couldn't find any detailed description of the error, nor how many checks this suppression would turn off.

In function ecma_builtin_helper_object_to_string the following is reported:

[jerry-core/ecma/builtin-objects/ecma-builtin-helpers.cpp:87]: (style) The scope of the variable 'buffer_size' can be reduced.

But I couldn't find any way to get rid of the error (moved the declaration earlier, moved a var declaration between the declaration of buffer_size az the local array allocation, removed the const specifier, etc.). Anyway, they would only have been hacks. Working around false positives of a static checker cannot be the motivation for refactoring the code so I dropped that idea and suppressed the error ID.

Not sure about alternatives.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and you are right. This is definitely a false positive. I actually like the variable scope check, so I'd like to keep it. If there is only one false positive then we can suppress only that with a //cppcheck-suppress variableScope comment in the previous line (jerry-core/ecma/builtin-objects/ecma-builtin-helpers.cpp:86). Could you try it?

@LaszloLango
Copy link
Contributor

Please update the copyright in the touched files.

@LaszloLango LaszloLango self-assigned this Feb 11, 2016
@LaszloLango
Copy link
Contributor

Please update docs/DEVELOPMENT.md too in this PR.

@akosthekiss akosthekiss force-pushed the no-prereq-cppcheck-vera branch from 583d60b to 9c4187e Compare February 11, 2016 07:32
@akosthekiss
Copy link
Member Author

Updated according to the review, and rebased to current master.

Rely on platform-provided versions. Thus, no need to download and
build them, neither to wrap them with shell scripts. CMake and
precommit updated to call the new tools. Development documentation
also updated/simplified.

PS: On my Ubuntu 14.04.3, cppcheck has version 1.61, while prereq
version was 1.69. The older version reports and fails on a strange
style issue in ecma/builtin-objects/ecma-builtin-helpers.cpp, for
which the only solution found was to suppress the cppcheck errors
with `variableScope` id for that file.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
@akosthekiss akosthekiss force-pushed the no-prereq-cppcheck-vera branch from 9c4187e to 20bec3d Compare February 11, 2016 09:02
@akosthekiss
Copy link
Member Author

Restricted the error suppression to the file with the false positive. Updated & rebased.

@LaszloLango
Copy link
Contributor

LGTM

@akosthekiss akosthekiss merged commit 20bec3d into jerryscript-project:master Feb 11, 2016
@akosthekiss akosthekiss deleted the no-prereq-cppcheck-vera branch February 11, 2016 09:56
@akosthekiss akosthekiss removed their assignment Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement infrastructure Related to GH Actions or the tested targets style Related to coding style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce prerequisite dependencies?
2 participants