Skip to content

Commit

Permalink
reformat readme to rst from markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
rizsotto committed May 16, 2016
1 parent 551ea0a commit fa9960b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 28 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.md
include README.rst
include *.txt
recursive-include libear *
71 changes: 45 additions & 26 deletions README.md → README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
[![Build Status](https://travis-ci.org/rizsotto/scan-build.svg?branch=master)](https://travis-ci.org/rizsotto/scan-build)
.. image:: https://travis-ci.org/rizsotto/scan-build.svg?branch=master
:target: https://travis-ci.org/rizsotto/scan-build

.. image:: https://img.shields.io/pypi/v/scan-build.svg
:target: https://pypi.python.org/pypi/scan-build

.. image:: https://img.shields.io/pypi/l/scan-build.svg
:target: https://pypi.python.org/pypi/scan-build

.. image:: https://img.shields.io/pypi/dm/scan-build.svg
:target: https://pypi.python.org/pypi/scan-build

.. image:: https://img.shields.io/pypi/pyversions/scan-build.svg
:target: https://pypi.python.org/pypi/scan-build

.. image:: https://badges.gitter.im/rizsotto/scan-build.svg
:target: https://gitter.im/rizsotto/scan-build?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge


scan-build
==========

A package designed to wrap a build so that all calls to gcc/clang are
intercepted and logged into a [compilation database][1] and/or piped to
intercepted and logged into a `compilation database`_ and/or piped to
the clang static analyzer. Includes intercept-build tool, which logs
the build, as well as scan-build tool, which logs the build and runs
the clang static analyzer on it.


How to get
----------

It's available from [the Python Package Index][2].
It's available from `the Python Package Index`_ ::

$ pip install scan-build

Or check out the sources and add the directory `bin` to your `PATH` environment.
Or check out the sources and add the directory ``bin`` to your ``PATH`` environment.


Portability
Expand All @@ -38,54 +56,54 @@ Prerequisites
How to use
----------

To run the Clang static analyzer against a project goes like this:
To run the Clang static analyzer against a project goes like this::

$ scan-build <your build command>

To generate a compilation database file goes like this:
To generate a compilation database file goes like this::

$ intercept-build <your build command>

To run the Clang static analyzer against a project with compilation database
goes like this:
goes like this::

$ analyze-build

Use `--help` to know more about the commands.
Use ``--help`` to know more about the commands.


Limitations
-----------

Generally speaking, the `intercept-build` and `analyze-build` tools together
does the same job as `scan-build` does. So, you can expect the same output
from this line as simple `scan-build` would do:
Generally speaking, the ``intercept-build`` and ``analyze-build`` tools
together does the same job as ``scan-build`` does. So, you can expect the
same output from this line as simple ``scan-build`` would do::

$ intercept-build <your build command> && analyze-build

The major difference is how and when the analyzer is run. The `scan-build`
The major difference is how and when the analyzer is run. The ``scan-build``
tool has three distinct model to run the analyzer:

1. Use compiler wrappers to make actions.
The compiler wrappers does run the real compiler and the analyzer.
This is the default behaviour, can be enforced with `--override-compiler`
This is the default behaviour, can be enforced with ``--override-compiler``
flag.

2. Use special library to intercept compiler calls durring the build process.
The analyzer run against each modules after the build finished.
Use `--intercept-first` flag to get this model.
Use ``--intercept-first`` flag to get this model.

3. Use compiler wrappers to intercept compiler calls durring the build process.
The analyzer run against each modules after the build finished.
Use `--intercept-first` and `--override-compiler` flags together to get
Use ``--intercept-first`` and ``--override-compiler`` flags together to get
this model.

The 1. and 3. are using compiler wrappers, which works only if the build
process respects the `CC` and `CXX` environment variables. (Some build
process respects the ``CC`` and ``CXX`` environment variables. (Some build
process can override these variable as command line parameter only. This case
you need to pass the compiler wrappers manually. eg.: `intercept-build
--override-compiler make CC=intercept-cc CXX=intercept-c++ all` where the
original build command would have been `make all` only.)
you need to pass the compiler wrappers manually. eg.: ``intercept-build
--override-compiler make CC=intercept-cc CXX=intercept-c++ all`` where the
original build command would have been ``make all`` only.)

The 1. runs the analyzer right after the real compilation. So, if the build
process removes removes intermediate modules (generated sources) the analyzer
Expand All @@ -103,15 +121,15 @@ for enabled security modes are: SIP on OS X Captain and SELinux on Fedora,
RHEL and CentOS.) The program checks the security modes for SIP and SELinux,
and falls back to 3. mode.

`intercept-build` command uses only the 2. and 3. mode to generate the
compilation database. `analyze-build` does only run the analyzer against the
``intercept-build`` command uses only the 2. and 3. mode to generate the
compilation database. ``analyze-build`` does only run the analyzer against the
captured compiler calls.


Known problems
--------------

Because it uses `LD_PRELOAD` or `DYLD_INSERT_LIBRARIES` environment variables,
Because it uses ``LD_PRELOAD`` or ``DYLD_INSERT_LIBRARIES`` environment variables,
it does not append to it, but overrides it. So builds which are using these
variables might not work. (I don't know any build tool which does that, but
please let me know if you do.)
Expand All @@ -121,7 +139,7 @@ Problem reports
---------------

If you find a bug in this documentation or elsewhere in the program or would
like to propose an improvement, please use the project's [issue tracker][3].
like to propose an improvement, please use the project's `issue tracker`_.
Please describing the bug and where you found it. If you have a suggestion
how to fix it, include that as well. Patches are also welcome.

Expand All @@ -132,6 +150,7 @@ License
The project is licensed under University of Illinois/NCSA Open Source License.
See LICENSE.TXT for details.

[1]: http://clang.llvm.org/docs/JSONCompilationDatabase.html
[2]: https://pypi.python.org/pypi/scan-build
[3]: https://github.com/rizsotto/scan-build/issues

.. _compilation database: http://clang.llvm.org/docs/JSONCompilationDatabase.html
.. _the Python Package Index: https://pypi.python.org/pypi/scan-build
.. _issue tracker: https://github.com/rizsotto/scan-build/issues
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
url='https://github.com/rizsotto/scan-build',
license='LICENSE.txt',
description='static code analyzer wrapper for Clang.',
long_description=open('README.md').read(),
long_description=open('README.rst').read(),
zip_safe=False,
scripts=['bin/scan-build',
'bin/intercept-build', 'bin/intercept-cc', 'bin/intercept-c++',
Expand Down

0 comments on commit fa9960b

Please sign in to comment.