Skip to content

Commit

Permalink
Merge pull request github#419 from github/skip-files-failing-tsg
Browse files Browse the repository at this point in the history
Skip failed files during indexing instead of aborting the whole index operation
  • Loading branch information
hendrikvanantwerpen authored Apr 10, 2024
2 parents a8c7109 + 7db914c commit 328942b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 8 additions & 0 deletions tree-sitter-stack-graphs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.8.2 -- unreleased

### CLI

#### Changed

- Failure to index a file will not abort indexing anymore, but simply mark the file as failed, as we already do for files with parse errors.

## v0.8.1 -- 2024-03-06

The `stack-graphs` dependency was updated to `v0.13` to fix the build problems of the `v0.8.0` release.
Expand Down
2 changes: 1 addition & 1 deletion tree-sitter-stack-graphs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tree-sitter-stack-graphs"
version = "0.8.1"
version = "0.8.2"
description = "Create stack graphs using tree-sitter parsers"
homepage = "https://github.com/github/stack-graphs/tree/main/tree-sitter-stack-graphs"
repository = "https://github.com/github/stack-graphs/"
Expand Down
18 changes: 5 additions & 13 deletions tree-sitter-stack-graphs/src/cli/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,23 +355,15 @@ impl<'a> Indexer<'a> {
if let Err(err) = result {
match err.inner {
BuildError::Cancelled(_) => {
file_status.warning("parsing timed out", None);
file_status.warning("timed out", None);
self.db
.store_error_for_file(source_path, &tag, "parsing timed out")?;
return Ok(());
}
BuildError::ParseErrors { .. } => {
file_status.failure("parsing failed", Some(&err.display_pretty()));
self.db.store_error_for_file(
source_path,
&tag,
&format!("parsing failed: {}", err.inner),
)?;
.store_error_for_file(source_path, &tag, "timed out")?;
return Ok(());
}
_ => {
file_status.failure("failed to build stack graph", Some(&err.display_pretty()));
return Err(IndexError::StackGraph);
file_status.failure("failed", Some(&err.display_pretty()));
self.db.store_error_for_file(source_path, &tag, "failed")?;
return Ok(());
}
}
};
Expand Down

0 comments on commit 328942b

Please sign in to comment.