Skip to main content

Allows for parsing LLVM Diagnostics output and create BB code insights accordingly

Project description

Python module for creating Code Insight Reports based on llvm-based diagnostics output.

Installation

$ pip install bitbucket-code-insight-reporter

Example

Example LLVM output:

test.cpp:6:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
int main() {
~~~ ^
auto       -> int
test.cpp:11:9: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
    if (hello + world == "")
        ^~~~~~~~~~~~~~~~~~~
        hello + world.empty()
../include/c++/v1/string:990:10: note: method 'basic_string'::empty() defined here
    bool empty() const _NOEXCEPT {return size() == 0;}
        ^
test.cpp:11:29: warning: statement should be inside braces [readability-braces-around-statements]
    if (hello + world == "")
                            ^
                            {
test.cpp:15:9: warning: use std::make_unique instead [modernize-make-unique]
    ptr.reset(new std::string{ "xyz" });
    ~^~~~~ ~~~~~~~~~~~~~~~~       ~
        = std::make_unique<std::string>
test.cpp:16:15: warning: use nullptr [modernize-use-nullptr]
    ptr.reset(NULL);
            ^~~~
            nullptr
test.cpp:19:5: warning: use range-based for loop instead [modernize-loop-convert]
    for (std::vector<int>::iterator it = vec.begin(); it != vec.end(); ++it)
    ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        (int & it : vec)
test.cpp:19:10: warning: use auto when declaring iterators [modernize-use-auto]
    for (std::vector<int>::iterator it = vec.begin(); it != vec.end(); ++it)
        ^
note: this fix will not be applied because it overlaps with another fix
test.cpp:19:77: warning: statement should be inside braces [readability-braces-around-statements]
    for (std::vector<int>::iterator it = vec.begin(); it != vec.end(); ++it)
                                                                            ^
                                                                            {

Example execution

code_insight_report_generator --id clang_format --title "Clang Format" --details "Overview of all warnings reported by Clang Format" --reporter "Bob Builder" --output ./path/to/report.json
code_insight_reporter --bitbucket-server https://bitbucket.url.com --username bob --password builder --llvm-logging ./path/to/logging.out --bitbucket-project BOB --repository-slug builder --commit-hash 1234567890 --report-file ./path/to/report.json

Usage

Usage: code_insight_report_generator [OPTIONS]

Options:
--id TEXT          Unique identifier for the report  [required]
--title TEXT       Humand readable title for the Code Insight report
                    [required]

--details TEXT     Additional details to share withing the Code Insight
                    report

--reporter TEXT    Reference to the reporter of the Code Insight Report
--link TEXT        Link towards an external report
--logo-url TEXT    Link towards an image to be shown in the Code Insight
                    report

--output FILENAME  Path towards the output file  [required]
--help             Show this message and exit.
Usage: code_insight_reporter [OPTIONS]

Options:
--bitbucket-server TEXT   URL for the BitBucket server  [required]
--username TEXT           Username associated with BitBucket  [required]
--password TEXT           Password associated with BitBucket  [required]
--llvm-logging TEXT       Path pointing to logging file containing llvm
                            diagnostics messages  [required]

--bitbucket-project TEXT  BitBucket project name  [required]
--repository-slug TEXT    BitBucket repository slug name  [required]
--commit-hash TEXT        Commit Hash to associate the Code Insights Report
                            with  [required]

--report-file FILENAME    Code Insights Report identifier  [required]
--help                    Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitbucket-code-insight-reporter-0.0.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file bitbucket-code-insight-reporter-0.0.3.tar.gz.

File metadata

  • Download URL: bitbucket-code-insight-reporter-0.0.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for bitbucket-code-insight-reporter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 25b57426609a82dbbe814a1089ebe953b1115f01faa66cfa2c7f117922dbe65b
MD5 a71030fc0895a1576c8bc4de2eae3c6d
BLAKE2b-256 27db8f4f73a161e51a768bde1e85e672778b7322164f62b2ccac61c60458ec8f

See more details on using hashes here.

File details

Details for the file bitbucket_code_insight_reporter-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: bitbucket_code_insight_reporter-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for bitbucket_code_insight_reporter-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6bac383b74526a45cce31e77ada90681f85d6e7d10e7ca0ed5b7fa0882a111cb
MD5 47ca7fb46dabeaa61fdfc0b91381d98d
BLAKE2b-256 a8bc939249a4b27468af9c13f06b90ba2e00a57a2657ddb716c7708a4c262734

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page