Skip to content

Added non-printable-ascii lint #66563

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

Closed
wants to merge 2 commits into from

Conversation

basil-cow
Copy link
Contributor

Closes #63682.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 20, 2019
@eddyb
Copy link
Member

eddyb commented Nov 20, 2019

r? @Manishearth

@rust-highfive rust-highfive assigned Manishearth and unassigned eddyb Nov 20, 2019
@petrochenkov petrochenkov self-assigned this Nov 20, 2019
@Centril
Copy link
Contributor

Centril commented Nov 20, 2019

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Collaborator

bors commented Nov 20, 2019

⌛ Trying commit 5026e3c with merge 824e298...

bors added a commit that referenced this pull request Nov 20, 2019
Added `non-printable-ascii` lint

Closes #63682.
@bors
Copy link
Collaborator

bors commented Nov 20, 2019

☀️ Try build successful - checks-azure
Build commit: 824e298 (824e29805174c0a9d70b21b714264efb390d045a)

@rust-timer
Copy link
Collaborator

Queued 824e298 with parent f50d6ea, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 824e298, comparison URL.

@Centril
Copy link
Contributor

Centril commented Nov 20, 2019

Perf is clean :)

@petrochenkov
Copy link
Contributor

Is is_ascii_control the right thing to use here?
Perhaps some unicode category would be more suitable here?
(This affects the lint name as well.)

@petrochenkov petrochenkov removed their assignment Nov 22, 2019
@basil-cow
Copy link
Contributor Author

сс @matklad

@JohnCSimon
Copy link
Member

JohnCSimon commented Nov 30, 2019

Ping from triage:
@Areredify Can you address the comment from petrochenkov, or is this PR done and ready for review?
Thank you.

@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2019
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

The tests should ensure that strings with escape codes work.

) {
const ALLOWED_ASCII_CONTROL_CHARS: [char; 2] = ['\t', '\n'];

if range.len() != 1 {
Copy link
Member

Choose a reason for hiding this comment

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

Why this check? Please add a comment.

span_with_quotes,
ast::CRATE_NODE_ID,
"non-printable ASCII character in literal"
)
Copy link
Member

@Manishearth Manishearth Nov 30, 2019

Choose a reason for hiding this comment

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

We should add a MachineApplicable suggestion for the appropriate escape sequence.

@basil-cow
Copy link
Contributor Author

@JohnCSimon Sorry for the late response. Original issue talks specifically about ASCII characters, IMO it makes sense to extend it to Cc characters, but I would like to hear @matklad opinion on this.

@joelpalmer
Copy link

Ping from Triage: any updates @Areredify @matklad?

@joelpalmer
Copy link

Ping from Triage: any updates @Areredify @matklad?

@JohnCSimon JohnCSimon added the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label Jan 18, 2020
@JohnCSimon
Copy link
Member

Triage:
@Areredify - unfortunately this PR hasn't seen any movement for over a month, so I'm closing this as inactive.
Thanks for your efforts, and feel free to reopen this PR when you have the time to update this and fix the merge conflicts.

Please don't push to the PR while it is closed as that prevents it from being reopened.

@JohnCSimon JohnCSimon closed this Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn about non-printable characters in string literals
10 participants