Commit graph

41 commits

Author SHA1 Message Date
Maxime Chretien
03f1d61e26 query.py: Add support for file families in queries
Also add a new query to get the family of a file.

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-05-22 10:29:24 +02:00
Maxime Chretien
ded9a1112e query.py: get latest indexed version instead of latest git version
This prevent bad queries when the git repo is more up to date than the
database.

Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-05-19 17:41:32 +02:00
Maxime Chretien
ac491ab3f8 filters/makefilefile.py : Make sure the file or directory exists before creating a link
Signed-off-by: Maxime Chretien <maxime.chretien@bootlin.com>
2020-05-13 17:45:09 +02:00
Christopher White
8a6031c8a1 Add doc-comment extraction
- find-file-doc-comments.pl: new file
- data.py: Add database to store doc-comment locations
- script.sh: Add parse-docs subcommand
- update.py:
  - Add code to process doc comments
  - Update some variable names in hopes of reducing confusion
- query.py:
  - Add code to report doc comments
  - Update some variable names in hopes of reducing confusion

Also:
- t/TestEnvironment.pm: Add find_doc attribute
- t/interact.pl: Don't die if update.py fails
- t/TestHelpers.pm: Permit checking specific sections of query.py output
- t/300: update regexes per the preceding
- gitignore tags (ctags output) and .cache (api_test.py output)
2020-04-02 13:03:03 -04:00
Carmeli Tamir
e969b88e8b Implemented query cmd commands for ident and file 2019-12-30 15:00:44 -05:00
Michael Opdenacker
51a6dff682 Python parentheses coding style fixes
- According to https://www.python.org/dev/peps/pep-0008/

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-01 07:01:26 +01:00
Michael Opdenacker
04643178a2 Incomplete tags: remplace "UNKNOWN" by "FIXME"
- More likely to be reported as a bug by users

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-10 10:11:13 +02:00
Michael Opdenacker
3e7682b8b5 Remove duplicated code in previous commit
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-10 10:09:16 +02:00
Naveen Kaje
120efbf730 Parse the tag levels when applicable
This patch fixes the error when the query on the tagging
expects 3 levels (v3 v3.1 v3.1-rc0) but gets only one level
from the `script.sh list-tags -h`, resulting in the following error:

<snip>
/home/naveen/workspace/elixir/query.py in query(cmd='versions', *args=())
     53         for line in scriptLines ('list-tags', '-h'):
     54             decoded_line = decode(line)
=>   55             topmenu, submenu, tag = decoded_line.split(' ')
     56             if db.vers.exists (tag):
     57                 if topmenu not in versions:
topmenu undefined, submenu undefined, tag undefined, decoded_line = 'Tag_V1', \
decoded_line.split = <built-in method split of str object>
<snip>

Fix the issue by initializing the levels to 'UNKNOWN' first and
then processing the menu levels when applicable.

Signed-off-by: Naveen Kaje <naveen.kaje@juul.com>
2019-10-09 10:40:30 -05:00
Michael Opdenacker
afe2c33689 Remove leftover code
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-08 07:35:35 +02:00
Michael Opdenacker
453e8a127c Factorize the definition of supported extensions
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-08 07:33:36 +02:00
Michael Opdenacker
96316cd0b8 Hot fix for the "get-latest" query
- Remove the trailing \n character that was breaking
  identifier search for the latest version.

- Don't hesitate to replace with a better/cleaner
  solution.

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-07 16:02:07 +02:00
Carmeli Tamir
1a91f04927 Straightened the interface between query and web, as preparation to add a json api parallel to web 2019-10-05 00:27:52 -04:00
Michael Opdenacker
3c78f8a0fc Add some comments
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-04 13:07:54 +02:00
Michael Opdenacker
c6aee2ad9d Improve progress reporting + factorize LXR_DATA_DIR access
- For long runs, allows to see which project we are in, and the
  percentage of processed tags

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-10-03 13:33:26 +02:00
Carmeli Tamir
d926243164 Refactored ident query to use python objects rather than parsing REs 2019-10-02 00:01:46 -04:00
Chen-Yu Tsai
0ab49d012f Add basic support for C++ files
Include C++ files when indexing and tokenizing files.

Unfortunately due to how C++ utilizes namespaces and classes, this
currently introduces a large amount of false positives for unqualified
identifiers that look the same.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2018-04-10 07:45:12 +00:00
Chen-Yu Tsai
883281e446 Use os.path.splitext to split out file extension
Python's standard library provides a function to split out file
extensions, and it also handles dot files correctly.

Use that instead of just retrieving the last two characters of
the file name.

This should help with issue #27.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2018-04-10 07:44:25 +00:00
Mikaël Bouillot
537e6b3a7b Change business name 2018-02-15 21:27:00 +00:00
Mikaël Bouillot
1b4c0fc7d4 Update notices to match the new license 2017-06-27 14:13:28 +02:00
Silvio Fricke
b7e1cd3215 change shebang to be more flexible
Python developers tend to use `virtualenv` then a fixed shebang is contra
productive.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2017-06-14 10:30:51 +02:00
Mikaël Bouillot
6df19c144c Turn query into function 2017-05-10 21:41:20 +02:00
Mikaël Bouillot
6d7694dff9 Indent query body to turn into function 2017-05-10 21:20:51 +02:00
Mikaël Bouillot
7db38c24fd Add support for virtual 'latest' version
Fixes #8
2017-05-01 19:14:08 +02:00
Mikaël Bouillot
471134bf85 Move version hierarchy logic to script.sh 2017-04-06 21:04:26 +02:00
Mikaël Bouillot
80e113ab99 Don't deduce type from trailing slash
Instead of using a trailing slash in the path to tell trees from blobs,
we actually ask git the type of the object. Also, if the object is a
tree but lacks a trailing slash, we redirect to the correct URL.

Fixes #6
2017-03-09 18:37:40 +01:00
Mikaël Bouillot
832f7c8b6d Add license 2017-03-09 17:25:42 +01:00
Mikaël Bouillot
48594e8d72 Handle multiple definitions of the same ident in one file
Fixes #1
2017-02-16 13:34:16 +01:00
Mikaël Bouillot
bab7dce487 Display only indexed versions 2017-02-14 13:23:37 +01:00
Mikaël Bouillot
95b4d78337 Open database read-only for queries 2017-02-14 13:11:34 +01:00
Mikaël Bouillot
fc3cf67a97 Temporary fix: handle defs/refs discrepancy gracefully 2017-02-13 13:55:42 +01:00
Mikaël Bouillot
c22e1dcec7 Bugfix: unknown version query 2017-02-13 13:23:18 +01:00
Mikaël Bouillot
0bf34d7751 Database update script, new data format 2017-02-06 15:15:51 +01:00
Mikaël Bouillot
3f0b68a0d7 Use environment variables for paths 2017-02-06 09:50:40 +01:00
Mikaël Bouillot
abbf08646a Split data module and add dummy element to iterators 2017-02-05 21:26:39 +01:00
Mikaël Bouillot
a479750bee Ident query and lots of data stuff 2017-02-05 21:02:10 +01:00
Mikaël Bouillot
4135084a0f Highlight comments 2017-02-05 11:34:33 +01:00
Mikaël Bouillot
8ad62ba1b6 Identifier matching rules 2017-02-05 11:14:48 +01:00
Mikaël Bouillot
cf0e1bd666 Directory and file queries 2017-02-05 10:27:36 +01:00
Mikaël Bouillot
10b9e273e7 Tweak script and print helpers 2017-02-05 08:38:43 +01:00
Mikaël Bouillot
2997686d70 Shell script and call from Python 2017-02-04 20:07:26 +01:00