Commit Graph

21 Commits

Author SHA1 Message Date
John Mulligan 961ff19bfd implements: don't panic if no counts for C functions are avaiable
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 29c18bcfd0 implements: report on stable functions in json output
Because there will be a lot of stable functions we only report on them
in the json report as the text report is more meant for summaries.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan d1aa76c613 implements: track all public functions, including stable ones
The go source (ast) visitor will now keep track of all public functions it
finds putting them into lists by category: deprecated, preview, stable.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 2ebd4bc1d5 implements: ignore some C package calls that are just noise
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 18a134b535 implements: gather more per-api-function stats into a struct
Do more than collect names, because we're going to need more information
to feed to the eventual check tool.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 12e7178bc0 implements: teach the implements tool to detect deprecated/preview funcs
Teach the implements tool how to detect functions marked deprecated and
marked preview in the go-ceph codebase. Especially helpful will be the
JSON output which can, in the future, be added to a tool-chain that
helps track when deprecated functions are to be removed and when preview
functions should become stable.

Note that this change ONLY implements the detection of
preview/deprecated based on the doc comments.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 6856f9efa2 implements: naming conventions: remove underscores from c stub vars
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan c1e544b8c3 implements: naming conventions: Xml -> XML
Fix up variable names that don't meet Go standards.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-13 15:13:53 +00:00
John Mulligan a4785fceb6 implements: add cli arguments to run multiple reports if requested
Add new arguments to 'implements' that allow for specifying one or more
report type and either a dash ('-' meaning stdout) or a file name to
control where the report is written.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-05 11:35:03 -04:00
John Mulligan 3e15044962 implements: add io.Writer argument when creating text report
This io.Writer will be the destination for writes from the report.
This better matches with what the JSON report was doing.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-06-05 11:35:03 -04:00
John Mulligan fa21b454ab implements: add brief description to build and use the tool
This is a dev tool mainly for just those of us who work on the project,
so this is mainly just a quick-start type description.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan fb7c0f6561 implements: renamed "covered" to "found"
To be clearer about what the tool detects, rename "covered" to "found"
such as not to indicate an undocumented but used function is considered
"covered". Future arguments about what "covered" really means to be
scheduled at a later date. :-)

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 3ad6ad0473 implements: drop --annotate option
Currently, annotating the functions (are they documented, deprecated,
etc) in the function listing is not very costly and there are very
few situations where that extra information would be unwanted. Just
annotate the listing every time when running the tool.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 141cd73223 implements: add implements cli interface
Add a main.go file to complete the `implements` cli tool.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 2d41cc93ca implements: add a JSON based report output
Allowing the tool to generate a JSON report makes it easier to add
additional tools later to make use of this data, without hand parsing
the text output.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 58745462e5 implements: add a textual report
Add simple reporting functionality to the implements package that is
intended to mimic the output of the current contrib/apicompare.py
script.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 49ac91b5b9 implements: process C sources use castxml
Add a file for processing C sources using the `castxml` tool. This tool
produces XML describing a C AST. This file adds go code for invoking the
tool and minimal processing of the XML it generates.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 18d8083de3 implements: add initial code for process Go sources
This code makes use of Go's native AST processing packages and allows us
to analyze our source code using the go-ceph conventions.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan ce7911ea35 implements: stub in the initial support for functions pulled from C
These types will be used to track what C functions are expected to be
implemented.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan 80300e4e5a implements: initialize the internal package with minimal logging support
This log.go file establishes the ability for the package's user to hand
it any logger that meets the very minimal interface.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00
John Mulligan f082075f26 implmements: introduce the implements tool
Mostly just a stub at the moment. Details to follow.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-17 11:26:46 -04:00