Commit Graph

58 Commits

Author SHA1 Message Date
Paolo Tranquilli
911d6f07b6 Shared tree-sitter extractor: run clippy 2025-08-11 17:04:22 +02:00
Paolo Tranquilli
45c0c46c9d Cargo: align rust toolchain version with internal repository
Also:
* remove new warnings raised by the rust toolchain
* run new formatting and linting
* update the rust toolchain used by `cargo`

While we keep `bazel` builds using the same toolchain as internally
(now a nightly one), I opted for using a stable toolchain for `cargo`.
The nightly toolchain is only required internally for build reasons, we
should keep not using any unstable rust features in our sources.
2025-08-11 16:45:47 +02:00
Nick Rolfe
b51940d1e2 Ruby: add overlay[local] annotations to AST/CFG/SSA layers 2025-07-08 13:09:27 +01:00
Nick Rolfe
7c5b186c71 Ruby/QL: add discard predicates for locations 2025-07-04 16:15:38 +01:00
Nick Rolfe
d8574a6919 Ruby: use overlayChangedFiles extensional in discard predicates 2025-07-03 12:44:15 +01:00
Nick Rolfe
72b4e67477 Java/Ruby/Rust/QL: add overlayChangedFiles relation to dbscheme 2025-07-03 12:44:09 +01:00
Nick Rolfe
867826466e Ruby/QL: unconditionally generate discard predicates 2025-06-25 15:35:58 +01:00
Nick Rolfe
57b866bbe1 Ruby/Rust/QL: move databaseMetadata to prefix.dbscheme
This has no effect on ruby.dbscheme, and adds the relation to
ql.dbscheme and rust.dbscheme. (The relation will be required for
overlay support).
2025-06-25 15:35:08 +01:00
Nick Rolfe
a9ddf0026b Ruby: generate overlay discard predicates 2025-06-25 11:47:27 +01:00
Nick Rolfe
665df4baef Ruby: add minimal path transformer support
Supports only a minimal subset of the project layout specification;
enough to work with the transformers produced by the CLI when building
an overlay database.
2025-06-19 16:34:16 +01:00
Nick Rolfe
1bd7c4f11c Ruby: add databaseMetadata relation to dbscheme
This is required for overlay support.
2025-06-19 16:34:15 +01:00
Paolo Tranquilli
923a2854cb Ruby, Rust: add zstd compression option 2025-05-28 16:41:55 +02:00
Paolo Tranquilli
d9ecb6255e Shared: fix clippy warning 2025-02-25 13:41:34 +01:00
Paolo Tranquilli
d2105a7528 Shared: format code again 2025-02-25 13:31:06 +01:00
Paolo Tranquilli
1bcc6ddb32 Rust/Ruby/Python: apply clippy lints 2025-02-25 13:21:28 +01:00
Paolo Tranquilli
6089a75262 Rust/Ruby/Python: format code 2025-02-25 13:19:03 +01:00
Paolo Tranquilli
e1f92b466f Merge pull request #18608 from github/aibaars/tracing
Rust: use tracing/tracing-subscriber for logging
2025-02-14 10:36:54 +01:00
Tom Hvitved
02fd23e53a Rust extractors: Normalize drive letter paths with a trailing / 2025-02-13 14:02:39 +01:00
Arthur Baars
5621eecc86 Rust: config: replace verbose with verbosity 2025-02-12 10:27:33 +01:00
Arthur Baars
c602e82ac4 Rust: use tracing-subscriber 2025-02-12 10:27:29 +01:00
Arthur Baars
a8fbb37569 TreeSitter extractors: log fewer lines
Printing a line for every extracted file is too verbose and for large projects makes it impossible to view the log in the Actions UI.
2025-02-07 12:28:17 +01:00
Paolo Tranquilli
b4b680775c Rust: integrate into standard files+location library 2024-09-12 13:17:10 +02:00
Paolo Tranquilli
6f36ea9188 Merge branch 'main' into rust-experiment
Conflicts:
  shared/tree-sitter-extractor/src/trap.rs
2024-09-09 14:15:34 +02:00
Paolo Tranquilli
2c472dd5b8 Tree-sitter: fix formatting 2024-09-09 11:59:17 +02:00
Paolo Tranquilli
4454566d8d Tree-sitter: allow multiple sources per trap file
This generalizes the location cache to allow multiple sources to be
extracted in the same trap file, by adding `file_label` to `Location`,
and therefore to location cache keys. This will be used by the Rust
extractor.
2024-09-09 09:17:45 +02:00
Paolo Tranquilli
7e1290aa74 Rust: reuse shared rust trap library 2024-08-30 16:08:37 +02:00
Tom Hvitved
beeae69845 Tree-sitter: Verbosity fixes 2024-05-31 20:10:19 +02:00
Tom Hvitved
d6a3765597 Tree-sitter: Allow for multiple file lists in simple extractor 2024-05-31 11:15:21 +02:00
Tom Hvitved
94d2e9591d Tree-sitter: Emit empty_location relation to avoid scan 2024-05-27 10:39:21 +02:00
Tom Hvitved
e4cd9d86f6 Tree-sitter: Respect verbosity defined in CODEQL_VERBOSITY 2024-05-23 13:38:35 +02:00
Tom Hvitved
a523be4d0a Tree-sitter: Add set_tracing_level to shared extractor module 2024-05-23 12:58:53 +02:00
Tom Hvitved
bf2ae9890f Tree-sitter: Bump to 0.22.6 2024-05-21 11:14:06 +02:00
Tom Hvitved
cee6f003fd Tree-sitter: Split up ast_node_info table into two tables 2024-03-19 10:52:37 +01:00
Rasmus Wriedt Larsen
07223031e8 Merge branch 'main' into lgtm_index_filter_handling 2024-02-26 09:56:02 +01:00
Nick Rolfe
514a92d5bd Tree-sitter extractors: use fresh IDs for locations
Since locations for any given source file are never referenced in any
TRAP files besides the one for that particular source file, it's not
necessary to use global IDs. Using fresh IDs will reduce the size of the
ID pool (both on disk and in memory) and the speed of multi-threaded
TRAP import.

The one exception is the empty location, which still uses a global ID.
2024-02-02 15:06:10 +00:00
Rasmus Wriedt Larsen
f20d4e22fe Handle only exclude 2024-01-18 13:54:45 +01:00
Rasmus Wriedt Larsen
54c7c5e8be Tree sitter extractor: Proper handling of LGTM_INDEX_FILTERS
If someone had used `LGTM_INDEX_FILTERS=exclude:**/*\ninclude:*.rb`
before, we would have mistakenly excluded all files :|
(LGTM_INDEX_FILTERS is a prioritized list where later matches take
priority over earlier ones)

This change is needed to support adding `exclude:**/*` as the first
filter if `paths` include a glob, which currently causes bad behavior in
the Python extractor. However, we can first introduce that change once
this PR has been merged.

I realize this change can cause more folders and files to be traversed
(since they are not just skipped with --exclude). We plan to make a
better long term fix which should bring back the previous performance.
2024-01-18 11:44:31 +01:00
Taus
ff35f9fb8c Shared: Clean up NodeInfo in shared extractor
I was perusing the shared extractor the other day, when I came across
the `NodeInfo` struct. I noticed that the `fields` and `subtypes` fields
on this struct had two seemingly identical ways of expressing the same
thing: `None` and `Some(empty)` (where `empty` is respectively the empty
map and the empty vector). As far as I can tell, there's no semantic
difference in either case, so we can just elide the option type entirely
and use the empty value directly. This has the nice side-effect of
cleaning up some of the other code.
2023-09-27 12:29:07 +00:00
Harry Maclean
b76842ad3d Shared: Fix clippy lint 2023-08-23 16:24:57 +01:00
Harry Maclean
3680613f2d Shared: Restrict extractor file globs to filenames 2023-08-23 16:09:56 +01:00
Harry Maclean
cc7ef5dac1 Shared: Fix clippy lint in shared extractor 2023-08-23 14:11:22 +01:00
Harry Maclean
7e2abf20c6 Shared: Support glob patterns in shared extractor
Replace the `file_extensions` field with `file_globs`, which supports
UNIX style glob patterns powered by the `globset` crate.

This allows files with no extension (e.g. Dockerfiles) to be extracted,
by specifying a glob such as `*Dockerfile`.

One surprising aspect of this change is that the globs match against the
whole path, rather than just the file name.

This is a breaking change.
2023-08-23 14:11:21 +01:00
Arthur Baars
2416568489 Tree-sitter-xtractor: fix clippy warnings 2023-05-22 19:37:58 +02:00
Arthur Baars
d2bc66e393 QL: switch to shared YAML extractor 2023-05-22 19:28:59 +02:00
Arthur Baars
9f83dd5c7a Tree-sitter extractor: extract shared dbscheme fragments into 'prefix.dbscheme' 2023-05-22 19:28:51 +02:00
Harry Maclean
48f22681a5 Merge pull request #13029 from hmac/ruby-autobuilder-refactor
Shared: Share autobuilder code between Ruby and QL
2023-05-12 18:24:06 +07:00
Harry Maclean
9203efbdc4 Shared: Share autobuilder code between Ruby and QL 2023-05-05 07:20:14 +00:00
Harry Maclean
a577bec22c Shared: Fix clippy warnings in shared extractor 2023-05-05 06:30:12 +00:00
Harry Maclean
8a89aec220 Shared: Handle trap compression option properly
Extracting the compression setting from an environment variable is the
responsibility of the API consumer.
2023-04-27 05:06:57 +00:00
Harry Maclean
ac1d250596 Shared: fix language prefix in extractor 2023-04-21 15:07:47 +07:00