c2go icon indicating copy to clipboard operation
c2go copied to clipboard

Add a dashboard of sqlite3 warnings

Open yulvil opened this issue 6 years ago • 6 comments

If the goal of the project is to transpile sqlite3.c, it would be good to have a measure of how many warnings have to be fixed in order to get there.

There are currently ~21,000 warnings. It would like to know how it evolves over time.

Correctness should be treated separately.

priority: low

yulvil avatar Oct 31 '17 04:10 yulvil

I agree and I have thought about how this could be done in a way that would not allow the progress to regress (new PRs creating new errors/warnings) but I don't think there is a nice way to do this without it being a huge burden/obstacle.

Perhaps a less intrusive way to indicate it is to use the Github API (from Travis) to add the amount of warnings as a PR status (like reviewable and travis) but have it always pass. It would be always publicly visible and if something changed the number radically it would be visible.

Who knows, it might even add a little competitiveness to trying to get the number lower! :P

Perhaps we could also track this number in something like codecov or a tool that manages metrics. However, the danger is that 21k warnings doesn't contain the warnings we simply don't know about yet so this number will get a lot bigger before it starts to reliably make its way down. I don't want that to be seen as lack of progress or a deterrent.

@yulvil I'm keen to hear your ideas?

elliotchance avatar Oct 31 '17 04:10 elliotchance

@elliotchance I am affraid I do not have many ideas on how to implement this for now. Travis writing the number of warnings to a file? I would not go as far as to block the merge if the number of warnings increases.

Maybe we can close this issue and reopen when we have a clear idea of how to implement (if it is worth implementing)?

yulvil avatar Oct 31 '17 04:10 yulvil

Leave this issue open, i've marked it as a question.

elliotchance avatar Oct 31 '17 04:10 elliotchance

It is nice idea. Let's create issue #281 and add feature like: Compare amount warnings between last master commit c2go and present local repository Preliminary by step:

  1. Download last master : git clone https://github.com/elliotchance/c2go.git /tmp/master-c2go git clone see [<directory>]
  2. Download sqlite // see example here : https://github.com/elliotchance/c2go/blob/master/travis/test.sh
  3. go run /tmp/master-c2go/main.go transpile -extract-only-warnings /tmp/master.warnings sqlite.c /// Need spicific flag for extract warnings from https://github.com/elliotchance/c2go/blob/f43f38f7a26c881d1279253215380007a0c9abab/program/program.go#L109
  4. go run ./main.go transpile -extract-only-warnings /tmp/present.warnings sqlite.c
  5. Run some tool for compare the different between *.warnings files. Note:
  • *.warnings file are json files (in my point of view) have list of warning and some statistic of warning.

Also, about criteria of success:

  1. If you create a PR with more warning and show more problems inside transpilator - it is success
  2. If you create a PR with less warning and solve problems inside transpilator - it is success.
  3. Some another - undefined state (in my point of view) - not good, not bad.

P.S. : we can create statictic of warning for all past commits.

Konstantin8105 avatar Oct 31 '17 06:10 Konstantin8105

@Konstantin8105 there is no need to add anything special to the c2go parameters, we can just use bash to do the same thing, something along the lines of:

cat sqlite3.go | grep "// Warning" | wc -l

As I mentioned before we cannot fail the build when the warnings increase as this early stage because there will be more warnings created as we discover them. For now just having the number visible would be a small helpful start.

elliotchance avatar Oct 31 '17 20:10 elliotchance

Is that issue closed?

Konstantin8105 avatar Feb 16 '18 13:02 Konstantin8105