summaryrefslogtreecommitdiff
path: root/src/rebar_prv_xref.erl
Commit message (Collapse)AuthorAgeFilesLines
* Support ignoring whole modules in xref resultsBryan Paxton2018-12-021-2/+4
| | | | | | | - Added support to rebar_prv_xref for filtering out whole module. A module may now be added to the list of xref_ignores in rebar.config or via -ignore_xref() module attribute - Added unit test for whole module filtering support to xref CT suite
* Optimize path handlingFred Hebert2018-10-111-2/+1
| | | | | | | | | | | | | | | | | - Only set paths that need to be put as a priority - Clean up paths before leaving API mode The first point accounted for some performance cost, but the latter one explains the 40% overhead in test runs: since rebar3 calls rebar3 a lot with a bunch of fake apps, and that the new mechanism for path handling by default does not _remove_ paths, it just _orders_ them, we would end up in a situation where as the tests ran, more and more fake paths would get added to the VM. By the time the run was over, all path handling would take longer since more paths needed filtering every time. By resetting paths at the end of an API run, we prevent a given 'project' from polluting another one's runtime and performance once the API successfully returns.
* Abstracted path managementFred Hebert2018-10-111-3/+2
| | | | | | | | | | | | | | | | Move path management out of rebar_utils manual code path function handling (which we leave there for backwards compat), and centralize them to allow easier coordination of paths between plugins and deps. On top of path handling, do a check of loaded modules to only purge and reload those that actually need it done in order to prevent all kinds of weird interaction and accidental purge kills. It also allows the possible cohabitation of both at once, with a "in case of conflict pick X" as a policy Changing path handling in providers also highlighted a bunch of bugs in some tests and appears to fix some in other providers, specifically around plugins.
* Unicode support in all the placesFred Hebert2017-08-061-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done through 3 main change groups: - replacing `~s` by `~ts` in format strings, so that strings that contain unicode are properly printed rather than crashing - adding the `unicode` argument to all function of the `re` module to ensure transformations on strings containing unicode data are valid instead of crashing (see issue #1302) - replacing `ec_cnv:to_binary/1` and `ec_cnv:to_list/1` with matching functions in `rebar_utils`. The last point has been done, rather than modifying and updating erlware commons, because binary and list conversions can be a contentious subject. For example, if what is being handled is actually bytes from a given binary stream, then forcing a byte-oriented interpretation of the data can corrupt it. As such, it does not appear safe to modify erlware commons' conversion functions since it may not be safe for all its users. Instead, rebar3 reimplements a subset of them (only converting atoms and chardata, ignoring numbers) with the explicit purpose of handling unicode string data. Tests were left as unchanged as possible. This may impact the ability to run rebar3's own suites in a unicode path, but respects a principle of least change for such a large patch.
* Don't crash when determining the source of undefined functions in stripped ↵Guilherme Andrade2017-08-051-4/+13
| | | | | | | | | | modules This can be reproduced by running xref analysis against a rebar3 plugin project which doesn't list rebar3 as an explicit dependency -- calls to certain bundled modules ('rebar_state', 'rebar_api', 'ec_cnv', ...) will result in a failed pattern match as these modules appear to have had their abstract code stripped.
* Fix cleanup_code_path for xref compile hookMikhail Kalashnikov2017-07-261-1/+2
|
* Prevent xref crashes with undef behavioursFred Hebert2017-06-131-2/+9
| | | | | | | | | When a given behaviour module does not exist, rebar3 brutally crashes. This patch makes it so instead, there is a warning output menitoning the missing behaviour, and this one is omitted from the unused function calls check. This means that unused calls will instead be shown for the module implementing a non-existing behaviour, as if no behaviour were declared in the first place.
* Fix xref compile hook on depsFred Hebert2017-06-071-2/+5
| | | | | | | | | | | If xref analysis is being run by a dependency during its compilation phase, the xref provider will try to add that deps' parents to the check job while the ebin/ directories for them do not exist. This causes a crash. This patch makes it so directories are only added if they are existing, preventing failure on any compile hook for dependencies and allowing successful compilation as a best effort.
* Fix rebar3 dialyzer warningsFred Hebert2016-11-191-1/+1
| | | | Some tricky changes in there but should be okay
* Add support for behaviors, and not just behavioursBrujo Benavides2016-09-281-1/+2
|
* Add support for xref_ignoresLouis-Philippe Gauthier2016-02-121-10/+12
|
* fix dialyzer warnings, except 'no local return' warningsTristan Sloughter2015-08-081-1/+1
|
* fix bareness issuesFred Hebert2015-05-311-1/+1
| | | | | | - Crashes in providers lib when no providers in a namespace are bare - Making sure bareness matches semantics; i.e. a bare provider is visible, a non-bare provider is hidden.
* remove uses of 'case catch'Tristan Sloughter2015-05-101-5/+5
|
* real bootstrappingTristan Sloughter2015-04-221-1/+1
|
* track and cleanup code paths for different contextsTristan Sloughter2015-04-211-17/+5
|
* Fixes #306: help text consistencyFred Hebert2015-04-021-1/+1
|
* Fix dialyzer warningsJames Fish2015-03-181-1/+1
|
* use PRV_ERROR for formattable errorsFred Hebert2015-03-161-1/+2
| | | | Also expose it in rebar_api
* copy project apps to deps output dir for compilationTristan Sloughter2015-02-281-1/+0
|
* Add xref support for multi-app projectsKelly McLaughlin2015-02-051-1/+2
| | | | | | | Add xref support for multi-app projects. Instead of only adding the top-level ebin directory to the xref server use rebar_state:project_apps/1 to enumerate the applications for the project and add the ebin directory for each one.
* Add xref provider for cross reference analysisKelly McLaughlin2015-02-051-0/+296
* Add a provider for the xref tool for running cross reference analysis on a project. Most of the code has been ported directly from the rebar2 rebar_xref module with some modification and cleanup to support testing. * Port over the eunit test suite from rebar2, but convert it to common_test. The testing is the same, but now the erlang term output is examined to determine if the test run is successful instead of scanning the console output for the expected strings.