Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

_tools/check_mod_exports.ts: modFilePath extracts file paths that are not strictly mod.ts files #6330

Open
jbronder opened this issue Jan 4, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@jbronder
Copy link
Contributor

jbronder commented Jan 4, 2025

Describe the bug
In the process of adding a file named unstable_chmod.ts to the @std/fs package to add towards #6255, running deno task lint:mod-exportsthe _tools/check_mod_exports.ts script will interpret unstable_chmod.ts as a mod.ts file and will emit warnings that fail the lint task.

Steps to Reproduce

  • Create a file that ends in *mod.ts, (e.g. fs/unstable_chmod.ts or fs/another_file_mod.ts) in the @std/fs package.
  • Run deno task lint:mod-exports.
❯ ls fs/
_create_walk_entry.ts       empty_dir_test.ts           mod.ts
_get_file_info_type.ts      ensure_dir.ts               move.ts
_get_file_info_type_test.ts ensure_dir_test.ts          move_test.ts
_is_same_path.ts            ensure_file.ts              testdata
_is_same_path_test.ts       ensure_file_test.ts         unstable_chmod.ts  # <-- newly created file
_is_subdir.ts               ensure_link.ts              unstable_chmod_test.ts
_is_subdir_test.ts          ensure_link_test.ts         unstable_errors.d.ts
_map_error.ts               ensure_symlink.ts           unstable_errors.js
_to_file_info.ts            ensure_symlink_test.ts      unstable_lstat.ts
_to_path_string.ts          eol.ts                      unstable_lstat_test.ts
_utils.ts                   eol_test.ts                 unstable_stat.ts
copy.ts                     exists.ts                   unstable_stat_test.ts
copy_test.ts                exists_test.ts              unstable_types.ts
deno.json                   expand_glob.ts              walk.ts
empty_dir.ts                expand_glob_test.ts         walk_test.ts

❯ deno task lint:mod-exports # NOTE: absolute path not shown for brevity
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './eol.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './empty_dir.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './ensure_file.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './ensure_dir.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './expand_glob.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './move.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './ensure_symlink.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './walk.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './copy.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './ensure_link.ts'.
Warn /Users/... .../deno_std/fs/unstable_chmod.ts does not export './exists.ts'.

Expected behavior
Expected the deno task lint:mod-exports to extract only mod.ts files.

Environment

  • OS: MacOS 13.7
  • deno version: 2.1.4
  • std version: Reproduced with @std/fs v1.0.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant