Move from File-Level to Pacakge-Level Parsing for Improved Linting #130
Labels
good first issue
Good for newcomers
L-performance
Lint: performance
T-engine
Type: related with engine (or internal)
Description
Currently, tlin's linting process handles
.gno
files by converting them into temporary.go
files (see,prepareFile
function) and parsing them one by one. This file-by-file approach has several drawbacks:.go
files and parsing each file separately is inefficient..gno
files within the same package context would reduce parsing overhead and improve overall speed.Proposed Solution
Create a Temporary Directory Structure
.go
temp file per.gno
file, copy or convert all.gno
files in a package into a temporary directory, renaming them with a .go extension.Parse Using Package-Level APIs
go/parser.ParseFile
(file-centric) togo/parser.ParseDir
or similar package-level APIs to load all files in a directory at once.Maintain
nolint
and Ignore Logicnolint
comments and path ignores still apply correctly across multiple files within the package.Note
Before proceeding with the task, benchmarks related to current file processing and parsing should be added first. Then the results should be compared after the modifications.
The text was updated successfully, but these errors were encountered: