Summary:
Conversion and reformat of infer source using ocamlformat
auto-formatting tool.
Current status:
- Because Reason does not handle docstrings, the output of the
conversion is not 'Warning 50'-clean, meaning that there are
docstrings with ambiguous placement. I'll need to manually fix
them just before landing.
Reviewed By: jvillard
Differential Revision: D5225546
fbshipit-source-id: 3bd2786
Summary:
Glorious, glorious man pages.
This changes a bunch of things that were hard to break up from the diff, so the
resulting diff is big.
Use `Cmdliner.Manpage` to format man pages (and also format a bit ourselves
since it is so stubborn).
As a bonus, introduce the following subcommands:
```
infer run ... # same as default mode with -- before
infer capture ... # -a capture
infer compile ... # -a compile
infer analyze ... # InferAnalyze
infer report ... # InferPrint
infer diff ... # this one is not new
infer clang ... # InferClang, not that you should use it
```
The man pages can still be improved a lot. Notable missing sections:
`ENVIRONMENT`, stuff about .inferconfig, some example usage, `DESCRIPTION`, ...
Reviewed By: jberdine
Differential Revision: D4921083
fbshipit-source-id: 9602230
Summary:
There are 2 possible places where to find toplevel.cmo:
- infer/_build/infer/toplevel.cmo, built by `make toplevel`
- infer/_build/test/infer/toplevel.cmo, built by `make test`
The test loading and running toplevel.cmo would give priority to the non-test
version of toplevel.cmo, which might be stale because `make test` doesn't
rebuild it.
This diff makes sure we use the test version of toplevel.cmo in `make test`.
Reviewed By: akotulski
Differential Revision: D4960550
fbshipit-source-id: 9c817ba
Summary:
We won't be needing to know the terminal size when we move the help to
manpages. Hopefully if we need C stubs again in the future we can refer back to
this diff to revive them.
Reviewed By: jberdine
Differential Revision: D4937491
fbshipit-source-id: 99139fa
Summary: This is required to upgrade OCaml as our ancient Reason is not available on 4.04.0.
Reviewed By: yunxing
Differential Revision: D4851582
fbshipit-source-id: 994a9a8
Summary:
This debugger stops the execution of CTL during the evaluation of formulas, then shows useful info about the current state:
- Which formula is being evaluated
- In which part of the AST is such formula being evaluated
- Line number of the source file
- Whether a CTL-Transition will take place or not
- Node-ID that can be related to the dotty file containing the evaluation graph (the one in infer-out/lint_dotty/)
The AST is shown with coloured nodes, where each colour has the following meaning:
- [Default terminal colour], Bold: The node is being evaluated
- Green, Bold: The formula returned true on the current node
- Red, Bold: The formula returned false on the current node
Reviewed By: ddino
Differential Revision: D4834451
fbshipit-source-id: c9aa970
Summary:
This removes the dependency of libffi, and gives better guarantees at
compile-time. A bit overkill to retrieve the width of the terminal but what do
you know...
Reviewed By: jberdine
Differential Revision: D4700003
fbshipit-source-id: 036989b
Summary:
This replaces the previous integration written in Python, which consisted in 1)
run the mvn command and parse its output to locate "directories containing
source files", 2) run on files named "*.java" in these directories. This meant
we had to run javac twice on each source file, and more importantly this
mechanism of finding source files was very fragile. In fact, I could not make
it work on several mvn projects I tried.
The new integration is based on parsing "pom.xml" to add an "infer-capture"
profile which instructs mvn to run `/path/to/infer` instead of `javac`. We also
add this profile to each maven submodule.
Users can specify an "infer-capture" profile themselves if the default one
doesn't work; in that case we don't inject our own "infer-capture" profile.
Reviewed By: jeremydubreil
Differential Revision: D4409613
fbshipit-source-id: d664274
Summary:
This diff adds a dependency on ctypes.foreign and uses the example
binding of fts to implement remove_directory_tree.
Reviewed By: yunxing
Differential Revision: D4115569
fbshipit-source-id: 3509955
Summary: Make it possible to run infer code from within `ocaml`/`utop`. Integration is really basic, but we can extend it if we find it useful.
Reviewed By: jberdine
Differential Revision: D3736029
fbshipit-source-id: 4cebb7c
Summary:public
It's a test, so infer/tests/ is a good place for it. Also, park the expected
outputs all in their own directory. This will help a future diff that changes
the gradle integration test.
Reviewed By: jeremydubreil
Differential Revision: D3019305
fb-gh-sync-id: d3a3ed8
shipit-source-id: d3a3ed8
Summary:public
- s/"/'/ in python strings
- kill `utils.error()` in favour of the new, identical `utils.stderr()`
- one more `print(utils.encode())` to `utils.stderr()` conversion
Reviewed By: jeremydubreil
Differential Revision: D2976710
fb-gh-sync-id: 6c0fdfa
shipit-source-id: 6c0fdfa
Summary:public
This attempts to properly sanitise text input/output in the Python parts of
infer. Do three things:
- encode user input (coming from the command-line or reading files)
- decode infer output
- in both cases, we may be using the wrong encoding, eg: locale says we're in
ascii, but the source code contains utf-8. In many cases, like error
messages, it's safe to ignore these encoding mismatches.
Also, since we `import __future__.unicode_literals`, it's safe to remove `u'`
prefixes on many unicode literals.
Reviewed By: martinoluca
Differential Revision: D2960493
fb-gh-sync-id: 9812d7d
shipit-source-id: 9812d7d
Summary:public
Adds test_build target to toplevel Makefile, which compiles
InferAnalyze, InferPrint, InferClang, and InferJava where warnings
listed in OCAML_FATAL_WARNINGS defined in infer/src/Makefile are fatal.
Other builds do not treat warnings as fatal. The test build is
performed in parallel with the tests by scripts/test.sh. This makes
refactoring and debugging easier, but prevents warnings from slipping
into the repo.
Also, make test target robust wrt parallel make.
Reviewed By: jvillard
Differential Revision: D2953085
fb-gh-sync-id: 5c0282a
shipit-source-id: 5c0282a
Summary:
public
The variable could be unitialized when the line number of an error is not in the base JSON report, which is currently the case for the errors in the test cases.
Reviewed By: jvillard
Differential Revision: D2913991
fb-gh-sync-id: d7e3857
shipit-source-id: d7e3857
Summary:
public
Check that gcc >= 4.7.2 or clang >= 3.1, which is necessary to compile clang
itself.
If we are compiling from a release, automatically use the compilers of the
plugins.
Reviewed By: jeremydubreil
Differential Revision: D2712706
fb-gh-sync-id: 430471f
Summary:
public
Create Makefile.config.in to hold paths to various source directories used
in infer/annotations/Makefile.
Reviewed By: jeremydubreil
Differential Revision: D2702986
fb-gh-sync-id: b5eb5bf
Summary: public
The main objective here is to reduce the list of changes as much as possible to that the change set in the JSON base case only relates to the changes in Infer
Reviewed By: sblackshear
Differential Revision: D2661085
fb-gh-sync-id: 113a695
Summary: public
Now that we have modules, we can gather string constants in one place only.
Reviewed By: jeremydubreil
Differential Revision: D2615791
fb-gh-sync-id: 7cc21e4
Summary: public
This unclutters infer/bin/ and gives more structure to infer/lib/
Reviewed By: jeremydubreil
Differential Revision: D2605809
fb-gh-sync-id: 508fc2c
Summary:
Create infer/src/backend/version.ml even if git is not installed or returns
errors. This is useful for source releases of Infer, which need to be able to
produce a sensible version number without a .git repository.
See also #167.