Skip to content

lgtm: Add initial LGTM configuration file #14713

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
merged 1 commit into from
Jun 9, 2021
Merged

Conversation

Patater
Copy link
Contributor

@Patater Patater commented May 27, 2021

Summary of changes

Add a starter LGTM configuration file that tells LGTM what sort of files
we have in Mbed OS, what dependencies need installing, how to configure,
and how to build.

We tell LGTM to build Mbed OS's unit tests for the host toolchain, as a
start.

We install pip so we can install pypi's version of CMake, which is newer
than the current LGTM default version of 3.13.4.

Impact of changes

None

Migration actions required

None

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label May 27, 2021
@ciarmcom ciarmcom requested a review from a team May 27, 2021 15:30
@ciarmcom
Copy link
Member

@Patater, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Add a starter LGTM configuration file that tells LGTM what sort of files
we have in Mbed OS, what dependencies need installing, how to configure,
and how to build.

We tell LGTM to build Mbed OS's unit tests for the host toolchain, as a
start.

We install pip so we can install pypi's version of CMake, which is newer
than the current LGTM default version of 3.13.4.
@Patater Patater marked this pull request as ready for review May 27, 2021 17:10
@Patater Patater requested review from LDong-Arm and rwalton-arm May 27, 2021 17:11
@Patater
Copy link
Contributor Author

Patater commented May 27, 2021

Tested with "Test analysis configuration" feature of LGTM. https://lgtm.com/logs/87580de577fb17410d210bbc0459a58e5f4872c3/lang:cpp

@Patater
Copy link
Contributor Author

Patater commented May 27, 2021

CI started

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

It's a nice addition, and a main point of building unit tests is to let LGTM find the code (instead of just testing, which we do in Travis).

What do Mbed OS maintainers think about this integration?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 2, 2021

I am not that familiar with it, but looks useful to have.

  • we will enable PR hook for this?
  • shall we enable also python (cli1 related tools as they are in the repo for the time being and also we got python helpers for CMake)

https://lgtm.com/logs/87580de577fb17410d210bbc0459a58e5f4872c3/lang:cpp

How to read this test run, the C/C++ passed. What does it report? I can see it built the unittests and run some analysis (the log is large and dont see any 0 errors or warnings or something) ? It would be useful to introduce LGTM.com to us who has not used it before.

@adbridge
Copy link
Contributor

adbridge commented Jun 4, 2021

I can't really review this as I have no context for what this is or is designed to do ?

@Patater
Copy link
Contributor Author

Patater commented Jun 9, 2021

How to read this test run

The test run shows that our LGTM file parsed correctly and that LGTM was able to do a build. It doesn't show you any of its static analysis results so far as I can tell. To get those, we'd need to merge the LGTM config file.

no context for what this is or is designed to do

It's static analysis, like cppcheck or Coverity Scan. Mbed OS already uses it for analysis Python code, but the tool can't figure out how to build Mbed OS without a custom configuration file, hence this PR.

You can see how it looks for C++ code by looking at the analysis of Mbed TLS. Here's how it looks currently for Mbed OS Python code.

@Patater Patater requested a review from rwalton-arm June 9, 2021 14:41
@Patater
Copy link
Contributor Author

Patater commented Jun 9, 2021

  • we will enable PR hook for this?

That's an option. I would want to see the results before deciding to do that.

  • shall we enable also python

This is already enabled, as no custom configuration was needed to get LGTM to analyze the Python code. You can see the Python results on LGTM.

@Patater
Copy link
Contributor Author

Patater commented Jun 9, 2021

CI started

@Patater Patater merged commit 88c0199 into ARMmbed:master Jun 9, 2021
@mbedmain mbedmain added release-version: 6.12.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants