gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
874 stars 355 forks source link

gno transpile should ignore hidden file/folder #1381

Open tbruyelle opened 9 months ago

tbruyelle commented 9 months ago

Under the hood, the gno transpile command uses the gnoFilesFromArgs() function, to collect all the gno files found in the path argument that should be processed. The problem is that this function is too greedy, it also returns gno files from the .git directory and these files are not true gno files (they don't contain gno code).

For example, when run inside this repository, the command returns errors like :

$ gno transpile .
.git/logs/refs/remotes/harry/hariom/get-rid-of-filetest.gno: precompile: parse: tmp.gno:1:1: expected 'package', found 0000000000000000000000000000000000000000 (and 1 more errors)

I think gnoFilesFromArgs() should filter out any hidden folders or files

thehowl commented 9 months ago

In #1299 I added package gnoutil in an effort to try to centralise the ways we do pkg and file matching.

I'd like to add this as part of that effort -- I'll need to change some things in the PR next week anyway.

tbruyelle commented 9 months ago

@thehowl Sounds like a good plan!

tbruyelle commented 2 months ago

@thehowl Since #1299 was closed without merging, what is the status of this issue ? Is there any pending work to make gnoFilesFromArgs() less greedy ?