17#ifndef A11_FLOW_DISCOVER_H_
18#define A11_FLOW_DISCOVER_H_
26#include <absl/types/span.h>
Everything the tools know about the world, in one place.
Definition catalogue.h:91
std::string path
Definition main.cc:135
std::vector< std::string > roots
Definition main.cc:137
constexpr std::string_view kCatalogueFormat
The format field of the catalogue envelope.
Definition catalogue.h:145
Result Discover(absl::Span< const std::string > roots, const Options &options)
Scans directories or files under roots for action declarations.
Definition discover.cc:1389
constexpr std::string_view kScanFormat
Scan results use the catalogue envelope format.
Definition discover.h:97
catalogue::Catalogue DiscoverInSource(std::string_view source, std::string_view path, Language language)
Scans supplied source and records path as its origin.
Definition discover.cc:1383
std::optional< Language > LanguageOf(std::string_view path)
The language a path's extension says it is, or nullopt for a file this does not read.
Definition discover.cc:1350
Language
A language an ActionSchema may be declared in.
Definition discover.h:42
Definition catalogue.cc:29
stores::ChunkStoreReaderOptions options
Definition runtime_streams.cc:31
Source location of a discovered entry, with 1-based line and column.
Definition catalogue.h:39
What to read and what to leave alone.
Definition discover.h:53
std::vector< std::string > skip_directories
Directory names never descended into.
Definition discover.h:57
static Options Default()
Options with the defaults filled in.
Definition discover.cc:1370
size_t max_file_bytes
Maximum file size read during a scan.
Definition discover.h:60
size_t max_entries
The most directory entries visited, including non-source files.
Definition discover.h:66
size_t max_files
The most files read in one scan.
Definition discover.h:63
Discovered actions and limits reached during the scan.
Definition discover.h:73
catalogue::Catalogue found
Definition discover.h:74
std::vector< std::string > too_large
Files skipped for being larger than max_file_bytes.
Definition discover.h:78
size_t entries_visited
Directory entries visited, including directories and non-source files.
Definition discover.h:82
bool reached_entry_limit
Whether max_entries stopped traversal.
Definition discover.h:84
size_t files_read
Files opened and read to the end.
Definition discover.h:76
bool reached_file_limit
Whether max_files stopped the walk before it ran out of files.
Definition discover.h:80