Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: glob and directory support for deno check and deno cache cli arg paths #25001

Conversation

yazan-abdalrahman
Copy link
Contributor

@yazan-abdalrahman yazan-abdalrahman commented Aug 12, 2024

Closes #24668
Closes #20813

@yazan-abdalrahman
Copy link
Contributor Author

@marvinhagemeister please review this PR?

let mut resolved_files = Vec::new();

for pattern in patterns {
let expanded = glob::glob(pattern).expect("Failed to read glob pattern");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this code should do something similar to what lint and fmt does (so not using glob directly and instead use PathOrPatternSet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done; please review it again.

@yazan-abdalrahman
Copy link
Contributor Author

@dsherret
can we merge it?

Copy link

@K1ngKP K1ngKP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue is solved?

@yazan-abdalrahman
Copy link
Contributor Author

yazan-abdalrahman commented Aug 18, 2024

@dsherret

done
image

I used the FileCollector with the same lint and fmt, but it did not support the requirement

`$ deno lint "./src/**/*.ts"

$ deno check "./src/**/*.ts"`

it should type check all files that match the glob pattern but in lint and format it didn't do that

check this
image

image

image

I think the previous method is better than using FileCollector with the same as format and lint.

@marvinhagemeister
Copy link
Contributor

@yazan-abdalrahman Could it be because the pattern is different in the screenshots? It's missing a * in the glob.

- deno check ".\src\*\*.ts"
+ deno check ".\src\**\*.ts"

@dsherret dsherret added this to the 1.46 milestone Aug 18, 2024
@dsherret dsherret self-assigned this Aug 18, 2024
@yazan-abdalrahman
Copy link
Contributor Author

".\src\**\*.ts"

@marvinhagemeister
image
same lint

@dsherret dsherret changed the title fix(check): Implement Globbing Support for File Type Checking feat: glob and directory support for deno check and deno cache cli arg paths Aug 20, 2024
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dsherret dsherret enabled auto-merge (squash) August 20, 2024 18:04
@dsherret dsherret merged commit a7c8bb1 into denoland:main Aug 20, 2024
17 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

globbing support when type checking feat: support passing directories to deno check
4 participants