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

feat: use fs-err in more places #2636

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

Hofer-Julian
Copy link
Contributor

I've noticed that there are still many places where we don't use fs-err

I've noticed that there are still many places where we don't use `fs-err`
@baszalmstra
Copy link
Contributor

We could add the following to a clippy.toml file at the root to make sure we use fs_err everywhere.

disallowed-types = [
  "std::fs::DirEntry",
  "std::fs::File",
  "std::fs::OpenOptions",
  "std::fs::ReadDir",
]

disallowed-methods = [
  "std::fs::canonicalize",
  "std::fs::copy",
  "std::fs::create_dir",
  "std::fs::create_dir_all",
  "std::fs::hard_link",
  "std::fs::metadata",
  "std::fs::read",
  "std::fs::read_dir",
  "std::fs::read_link",
  "std::fs::read_to_string",
  "std::fs::remove_dir",
  "std::fs::remove_dir_all",
  "std::fs::remove_file",
  "std::fs::rename",
  "std::fs::set_permissions",
  "std::fs::soft_link",
  "std::fs::symlink_metadata",
  "std::fs::write",
]

@Hofer-Julian
Copy link
Contributor Author

disallowed-types = [
  "std::fs::DirEntry",
  "std::fs::File",
  "std::fs::OpenOptions",
  "std::fs::ReadDir",
]

disallowed-methods = [
  "std::fs::canonicalize",
  "std::fs::copy",
  "std::fs::create_dir",
  "std::fs::create_dir_all",
  "std::fs::hard_link",
  "std::fs::metadata",
  "std::fs::read",
  "std::fs::read_dir",
  "std::fs::read_link",
  "std::fs::read_to_string",
  "std::fs::remove_dir",
  "std::fs::remove_dir_all",
  "std::fs::remove_file",
  "std::fs::rename",
  "std::fs::set_permissions",
  "std::fs::soft_link",
  "std::fs::symlink_metadata",
  "std::fs::write",
]

Great idea!

Done!

@Hofer-Julian Hofer-Julian merged commit 3589d78 into prefix-dev:main Dec 3, 2024
30 checks passed
@Hofer-Julian Hofer-Julian deleted the feat/fs-err branch December 3, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants