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

Document IO Error #6712

Merged
merged 3 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions crates/ruff/src/rules/pycodestyle/rules/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ use ruff_source_file::Locator;

use crate::logging::DisplayParseErrorType;

/// ## What it does
/// This is not a regular lint, instead it is raised when a file can not be read.
///
/// ## Why is this bad?
/// This indicates an error in the development setup. A common cause of IO errors is that the
/// current user doesn't have the permission to read the file. Another possible reason is a broken
/// symlink.
///
/// ## Example
/// On linux:
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this be unix or linux and Mac OS instead?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah maybe like Linux or macOS?

Copy link
Member Author

Choose a reason for hiding this comment

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

TIL they switched from Mac OS X to macOS in 10.12

/// ```shell
/// $ echo 'print("hello world!")' > a.py
/// $ chmod 000 a.py
/// $ ruff a.py
/// a.py:1:1: E902 Permission denied (os error 13)
/// Found 1 error.
/// ```
///
/// ## References
/// - [UNIX Permissions introduction](https://mason.gmu.edu/~montecin/UNIXpermiss.htm)
/// - [Command Line Basics: Symbolic Links](https://www.digitalocean.com/community/tutorials/workflow-symbolic-links)
#[violation]
pub struct IOError {
pub message: String,
Expand Down
Loading