onflow / onflow/flow-cli

`flow cadence lint` lints imports

Open Beginner friendly
#2,326 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Improvement
Dominant language
Go
Stars
209
Forks
87
Avg merge
1d 17h
Merged PRs (30d)
3

Description

Summary

flow cadence lint discovers .cdc files starting from . (the project root) when no --base-dir is provided. The standard Flow project layout puts own .cdc files in cadence/.
Linting from . causes the linter to process files it shouldn't — in particular, imports/.

Expected behavior

Don't lint imported dependencies.

Root cause

In internal/cadence/lint.go, findAllCadenceFiles is called with "." when --base-dir is not set.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in internal/cadence/lint.go at findAllCadenceFiles and the call that passes "." when --base-dir is unset. Run flow cadence lint on a standard project layout containing cadence/ and imports/ to confirm the current discovery behavior. Done means the command lints project .cdc files without processing imported dependencies when no base directory is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.