-
Notifications
You must be signed in to change notification settings - Fork 5
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
Basic Linter #41
base: main
Are you sure you want to change the base?
Basic Linter #41
Conversation
checks 80-character limit Includes TODO to create ownership check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far but two questions
} | ||
|
||
// go through all arguments (names of files to read) | ||
for (idx,fname) in args().enumerate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Does this require you to manually input every file you want checked? If so, that's fine for now, but the goal is to be able to input a folder like /site
and have it check every .ts
and .svelte
file without having to manually write them out.
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why are these included in the dependencies? They are necessary for datagen
but I don't think they're necessary for this linter. If these were automatically included then that's alright
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically included, likely because of the previous one.
Also, personally I think it makes sense to wait to merge this PR until the ownership check is done. |
Ok(text) => text | ||
}; | ||
|
||
if text.len() > 80 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Does this count the number of characters in a line or the number of bytes? I remember this being an issue for one of the CMSC 330 projects. I think we should be counting the number of characters, counting multi-byte Unicode characters as one char since that's how they're displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the way we counted characters, the length is 1:1 with each character if I recall correctly.
By the way, you didn't have to do this in Rust if you'd rather do it in something like Python or another language. Entirely up to you |
Creating a preliminary linter, currently only checks for 80-character lines.