LGTM (split from 'Code quality checker' thread)

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
saso
Posts: 1359
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Code quality checker

Postby saso » Mon Jul 08, 2019 11:23 am

bernd wrote:
Mon Jul 08, 2019 11:04 am
ahh, ok. Would you move these files out of excluded files? They should be analysed as any other file in FEM.
They are analyzed (check the test files from some other workbenches, they show alerts), they are just excluded from the statistics... I would leave it as it is. https://lgtm.com/help/lgtm/file-classification
User avatar
saso
Posts: 1359
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Code quality checker

Postby saso » Fri Jul 12, 2019 9:49 am

Small update on the LGTM C++ analysis... Unfortunately FreeCAD project is much too big for how the LGTM service is set up currently. A test build timed out after 5h and the build was done only about 38%. So it seems like it will be python only for now.

I have created a pull request for the lgtm analysis configuration file with the file classification for a few generated python files, including the config_control_design.py mentioned by bernd. https://github.com/FreeCAD/FreeCAD/pull/2336
User avatar
Joel_graff
Posts: 1612
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: LGTM (split from 'Code quality checker' thread)

Postby Joel_graff » Sat Oct 19, 2019 2:56 pm

That's a shame LGTM can't handle it - I love using it for Python.

If a one-time code analysis would be useful, perhaps the repo could be split into two (or more) separate projects and analyzed that way?
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
saso
Posts: 1359
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: LGTM (split from 'Code quality checker' thread)

Postby saso » Sat Oct 19, 2019 3:27 pm

Joel_graff wrote:
Sat Oct 19, 2019 2:56 pm
That's a shame LGTM can't handle it - I love using it for Python.
you are using it for your workbench/addon right? maybe you could write a short tutorial here for others to show and share some experience on how to set it up and use it for the addons development, since the discussion up until now was mostly about using it on the code from the master... ?
Last edited by saso on Sat Oct 19, 2019 3:28 pm, edited 1 time in total.
User avatar
Joel_graff
Posts: 1612
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: LGTM (split from 'Code quality checker' thread)

Postby Joel_graff » Sat Oct 19, 2019 3:28 pm

I could possibly try to write a Wiki enttry or something.

This also goes with my attempt at building a better workbench starterkit (which I've been neglecting)...
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
Joel_graff
Posts: 1612
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: LGTM (split from 'Code quality checker' thread)

Postby Joel_graff » Sat Oct 19, 2019 5:06 pm

FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
Kunda1
Posts: 6202
Joined: Thu Jan 05, 2017 9:03 pm

Re: LGTM (split from 'Code quality checker' thread)

Postby Kunda1 » Sat Oct 19, 2019 7:54 pm

Joel_graff wrote:
Sat Oct 19, 2019 5:06 pm
https://www.freecadweb.org/wiki/LGTM
Cool, what wiki categories can we add this to ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1612
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: LGTM (split from 'Code quality checker' thread)

Postby Joel_graff » Mon Oct 21, 2019 11:46 am

Kunda1 wrote:
Sat Oct 19, 2019 7:54 pm
Cool, what wiki categories can we add this to ?
After looking at the categories a bit, I'd say it belongs under the Developer's documentation. But, I might also suggest a separate section devoted to getting started with Python in FreeCAD in the Developer's docs. That would talk about setting up a github account, provide the template readme.md file, link to the workbench starter-kit, and include LGTM and other FreeCAD / Python / Github things like setting up PyLint in various IDE's...

That, at least, would be the ideal situation. There isn't much to have to write a 'getting started' for python development, I think - most of it is just describing the various elements and providing relevant links.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
saso
Posts: 1359
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: LGTM (split from 'Code quality checker' thread)

Postby saso » Mon Oct 21, 2019 11:53 am

Great! Would be interesting to see if some of the existing developers/workbenches would start using it... I am guessing that, for example if Chris_G would start using it for his Curves WB, there is not a lot for him to do since he already has everything at GitHub?

With other words, for some that is using GitHub, is it the easiest way to set up lgtm by installing it in GitHub as an GitHub App or to log in at https://lgtm.com/ with the GitHub account...?

Update: Ok, so it seems that adding a project to lgtm is quite easy and actually anyone (not just the owner) can do it, for a test I have logged in at https://lgtm.com/ and added CurvesWB https://lgtm.com/projects/g/tomate44/CurvesWB/ (hopefully you are not angry about it Chris :roll:). It took just one or two clicks, but it is then up to the owner to set up the different lgtm configuration options if he/she wants or needs to...
Chris_G wrote: ping
Last edited by saso on Mon Oct 21, 2019 12:47 pm, edited 8 times in total.
User avatar
Kunda1
Posts: 6202
Joined: Thu Jan 05, 2017 9:03 pm

Re: LGTM (split from 'Code quality checker' thread)

Postby Kunda1 » Mon Oct 21, 2019 11:57 am

Joel_graff wrote:
Mon Oct 21, 2019 11:46 am
Kunda1 wrote:
Sat Oct 19, 2019 7:54 pm
Cool, what wiki categories can we add this to ?
After looking at the categories a bit, I'd say it belongs under the Developer's documentation. But, I might also suggest a separate section devoted to getting started with Python in FreeCAD in the Developer's docs. That would talk about setting up a github account, provide the template readme.md file, link to the workbench starter-kit, and include LGTM and other FreeCAD / Python / Github things like setting up PyLint in various IDE's...

That, at least, would be the ideal situation. There isn't much to have to write a 'getting started' for python development, I think - most of it is just describing the various elements and providing relevant links.
:+1:
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features