Commit Graph

31 Commits

Author SHA1 Message Date
Charly Delay
b54fbf7c21 gnathub: implement --[runners|reporters]-only
Teach those two switches to GNAThub's command line and wire them within
gnathub.

Change-Id: Ie6db3c8034650499123bd3e6405567296ab89362
TN: P720-035
2017-01-19 10:46:08 -05:00
Charly Delay
c53730d781 gnathub: introduce Runner & Reporter interface
The GNAThub.Plugin class is no longer an abstract class and
GNAThub.Runner & GNAThub.Reporter are two new interfaces exposing
respectively run() and report(). Plugins now have tools execution
done in run() methods, and results collection done in report() methods
(when it make sense for the plugin, ie. coverage plugins only implement
the GNAThub.Reporter interface whereas eg. CodePeer plugin implements
both GNAThub.Runner and GNAThub.Reporter interfaces).

Change-Id: Ic702a98eb3bb02e7f7416b5ff3c998f9b20eaefc
TN: P720-035
2017-01-18 16:04:50 -05:00
Charly Delay
8d2ee4d2e4 gnathub: add support for --targs:
Change-Id: I7b5127b1801e61a28dfa2faf0e0e9fb69f7a6e59
TN: PC20-033
2016-12-22 10:19:27 -05:00
Charly Delay
3674e8b844 chore(testsuite): make sure Exec_Dir is tested
Change-Id: I4e8b4ecdf3f55e4b36fa66fa08f49a2a58915293
TN: PA28-026
2016-11-28 13:05:52 -05:00
Charly Delay
336f0f4027 feat(webui): add support for message properties
Message can now be attached properties. This is first used to specify
whether a CodePeer message is "New" or not.

Change-Id: I1a3d0c1b2b3a97d6601e0e6782b5cc059bf55d0d
TN: P720-036
2016-09-02 15:06:08 -04:00
Charly Delay
d7124595d0 gnathub: remove obsolete GNATprove plugin
This plugin stopped working some time ago due to major changes in
GNATprove output. Remove support for it as it will be re-implemented as
part of P701-003.

Change-Id: I7c0b6399243a865c57211b0f2c16573bf5ed63a9
TN: P701-003
TN: N805-021
2016-07-26 16:42:45 +02:00
Charly Delay
16fbf6c5a4 feat(GNAThub.Tool): new clear_references function
GNAThub.Tool.clear_references(tool_name) deletes from the database any
entry related to that tool in the following tables:

    * entities_messages
    * resources_messages
    * messages
    * rules
    * tools

Change-Id: Ib2adfccffc37544b60ea120133d47daef527aebb
TN: O225-028
2016-06-02 14:06:37 -04:00
Charly Delay
bbff367312 GNAThub.source_files(): new function
This new function lists source files on a per project basis. This is
more accurate than using GNAThub.source_dirs() and list the content of
each source directory.

Change-Id: I4cea06be722afa51eea3339070a263225e52f5f6
TN: P310-015
2016-03-11 12:57:07 +01:00
Charly Delay
b02ce249ee gnathub: add support for --dry-run switch
Add a [ --dry-run | -n ] switch to execute GNAThub in dry-run mode.
Dry-run mode skips DB manipulation (initialisation, population, update),
environment setup (project directory hierarchy, ...) and Python script
execution (when using --exec). It also prevents the execution of
plugins.

Change-Id: Ibe160ffc739d7027f9c56940832656d0e8a126a0
TN: P303-043
2016-03-07 20:13:17 +01:00
Charly Delay
bb0972a6e8 gnathub: export GNAThub.quiet()
Add missing GNAThub.quiet() to the Python API exported routines.

Change-Id: I7ef8ff33491bcf0f2c336fe141ce1a044406a686
TN: P304-012
2016-03-04 11:25:00 +01:00
Charly Delay
cf7de3c106 testsuite: refactor for clarity and maintenance
Change-Id: I1d500175c06a0839268c8a3c4bfc31043c1bf259
2015-09-30 18:23:28 +02:00
Charly Delay
67aa11f229 testsuite: minor test reformating
Extract the test about cross support in two separate test cases in
tests.api-python.project:

 * check-cross-api.py
 * check-cross-api-override.py

Change-Id: I7a2e3de80f0193553a5879bad55032f6b2bd5abd
TN: O909-050
2015-09-30 03:41:48 +02:00
Charly Delay
20b809d27c gnathub: add support for cross options (--target, --RTS)
* add support in GNAThub for --target and --RTS command line
   switches.
 * add support for Target and Runtime attributes defined in the project
   file.
 * add tests to cover the new API methods (Project.target &
   Project.runtime).

Change-Id: I42a88471598fefec16a7505ad70cd24b08f3dd8b
TN: O909-050
2015-09-28 21:56:06 +02:00
JC Delay
be4e020101 Add a test for GNAThub.Project.scenario_switches()
Change-Id: I5757f952ff8f2656d7de52b8de929f471b2de857
2015-05-27 17:43:32 +02:00
JC Delay
caf8b756bd Revamp of the documentation
This commit introduces several changes:

  * rewrite the docstring of Python scripts to use AdaCore style and
    have a consistent documentation notation across projects
  * add plug-ins documentation to the generated doc, so that users don't
    need to dive into the source files when developing their own
    plug-ins
  * use a custom style for the HTML documentation (lighter & easier to
    read)

Change-Id: Ied42183e866ee552b90af2f4ef1d2410be601ca4
2014-10-13 17:03:34 +02:00
JC Delay
1233534158 Unify GNAThub.Plugin.name()
Provide a default implementation to the GNAThub.Plugin.name property:

    return type(self).__name__

Use plugin().name along with plugin.__name__ to discriminate plugins
from their name in the plugin-runner.py.

Change-Id: Ie478427ffd78c45cdab8dd1e842b3736020cd710
TN: N623-022
2014-08-14 19:48:58 +02:00
JC Delay
989f781fec Prints command-lines on STDOUT if --verbose supplied.
Exports a new function GNAThub.verbose() in Python which returns True if
--verbose was supplied to GNAThub, False otherwise.

Use this to choose whether to display the command-line executed by
GNAThub plugins to invoke tools.

Change-Id: Iefd5d709b2fa2bb2639816b9d8da7c0b1ece7b53
TN: N806-028
2014-08-08 15:28:34 +02:00
Nicolas Setton
0e2041d3aa Adjust baseline
Adapting to the fact that we now output the command being
run.

Change-Id: Ie2a85c19d3658d6c59d0dec675ea0d8b4f333bed
2014-08-08 11:20:16 +02:00
JC Delay
13d92f6f58 gnathub: add test for project attribute Project_Name.
Change-Id: If421b217f8db0d348ebe5f67f881b1d93885e7f3
TN: N702-022
2014-07-03 12:25:15 +02:00
JC Delay
71720f2491 gnathub: add support for fetching any project-attribute.
The lack of such support was uncovered by a customer that wants to
access the "Main" attribute of the project file. Generalizing the
"Property_As_String" and "Property_As_List" routine is simple enough and
does not break backward compatibility.

src/gnathub/ChangeLog:

  * gnathub-project.ad? (GNATdashboard_Package): Rename the constant for
    consistency with GNATCOLL.Project and make its declaration public so
    that it can be referenced from other packages (in particular:
    GNAThub.Python).
    (Property_As_List, Property_As_String): New optional parameter
    "Package_Name". Defaults to GNATdashboard_Package.
  * gnathub-pyhton.adb (Register_Project_Class): Register the optional
    parameter "package" to Python static methods property_as_list and
    property_as_string.

src/lib/GNAThub/ChangeLog:

  * __init__.py (property_as_list, property_as_string): Update
    documentation.

testsuite/tests/api-python/project/*:

    * Add a new test to extract the "main" attribute from the project
      file.

features-10: New features file to keep track of enhancements.

Change-Id: I2f6808b95f76581432e0893847b951183d4ca341
TN: N623-022
2014-06-30 14:05:02 +02:00
JC Delay
f8868fabac Tentative fix for test api-python.project on Windows.
Change-Id: If86fb3428cd7cf57aadd6dc1bcc78ef203b6394f
Issue: DSH-60
2014-04-27 12:07:29 +02:00
JC Delay
497fa66e8b gnathub: update testsuite with new support.
Change-Id: Id628a5f3eff0776c91315aac54db2db8ed828495
Issue: DSH-60.
2014-04-25 16:48:22 +02:00
JC Delay
cfe2d2c397 Update result of GNAThub.Project.source_dirs
This static method now returns a dictionary associating project name to
a list of source directories.

This will be needed when integrating imported projects as modules within
SonarQube.

Change-Id: If92313c8ea68cf7d17728c26d6d57f415792c6ba
2014-04-10 19:32:08 +02:00
JC Delay
6b7eacf677 Update GNAThub.Plugin interface.
Remove two deprecated methods: fqn and display_command_line(), and a
deprecated attribute: LOG_FILE.
Also refactor the code and normalize the plug-ins output.

Change-Id: I1a346f0dc4c705cf03199f348006aabdab0ad56f
2014-03-31 19:05:24 +02:00
JC Delay
e7d4c7147d Refactor logging module.
Distinguish routines to print GNAThub output with routines to log the
execution of GNAThub and its plug-ins.

Define a new Logger class and export it to Python. Plug-ins can simply
use the pre-defined self.log instance variable for logging.

Update all occurrences of printing and logging in the sources.
Also update two tests to ensure they do not attempt to run any other
plug-in than SonarConfig.

Change-Id: I47bd3a4fc243a70c12138ca2b8e854d770dbae82
2014-03-31 15:23:57 +02:00