Commit Graph

32 Commits

Author SHA1 Message Date
Sven Anderson 423c7ca899 implements: use ceph_preview tag instead of PREVIEW comment
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-06-06 14:42:04 +00:00
John Mulligan a54c6e74e3 implements: a public function's type must be exported too
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-04-28 02:50:10 +00:00
Sven Anderson 4ef3865bb3 implements: analyze all but internal packages
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-04-12 17:53:06 +00:00
Sven Anderson f6eeb68e33 contrib/implements: move into independent module
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-21 14:45:42 +00:00
Sven Anderson cf77731927 contrib/implements: remove some linter noise
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-21 14:45:42 +00:00
Sven Anderson 0b907cf04f contrib/implements: replace castxml with cc library
Signed-off-by: Sven Anderson <sven@redhat.com>
2022-02-21 14:45:42 +00:00
John Mulligan f27408f8bf contrib: add common/admin/manager to implements
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-08 15:55:02 +00:00
Sven Anderson cee047149f tools: update implements tool to new deprecated/preview style
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 18:58:35 +00:00
Sven Anderson 97630486ee contrib: implements tool prints stderr if castxml fails
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-10-04 15:49:43 +00:00
John Mulligan f986a965ca implements: always include the ceph_preview build tag
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
John Mulligan 3590347f60 implements: add support for scanning the api of the "admin" subpackages
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2021-09-30 13:27:01 +00:00
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