Skip to content

Modify script to prevent further violations of snake_case - #25547

Merged
bors-servo merged 1 commit into
servo:masterfrom
kunalmohan:25531-SnakeCase
Jan 20, 2020
Merged

bors-servo merged 1 commit into
servo:masterfrom
kunalmohan:25531-SnakeCase

Conversation

@kunalmohan

Copy link
Copy Markdown
Contributor

Remove #![allow(non_snake_case)] from script/lib.rs and add #[allow(non_snake_case)] at each instance of violation.


@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/request.rs, components/script/test.rs, components/script/dom/textencoder.rs, components/script/dom/rtcpeerconnectioniceevent.rs, components/script/dom/dompoint.rs and 126 more
  • @KiChjang: components/script/dom/request.rs, components/script/test.rs, components/script/dom/textencoder.rs, components/script/dom/rtcpeerconnectioniceevent.rs, components/script/dom/dompoint.rs and 126 more

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 17, 2020
@jdm

jdm commented Jan 17, 2020

Copy link
Copy Markdown
Member
error: variable `storeBindings` should have a snake case name
   --> components/script/dom/gpudevice.rs:253:17
    |
253 |         let mut storeBindings = HashSet::new();
    |                 ^^^^^^^^^^^^^ help: convert the identifier to snake case: `store_bindings`
    |
    = note: `-D non-snake-case` implied by `-D warnings`
error: variable `maxLimits` should have a snake case name
   --> components/script/dom/gpudevice.rs:258:13
    |
258 |         let maxLimits = MaxLimits {
    |             ^^^^^^^^^ help: convert the identifier to snake case: `max_limits`
error: aborting due to 2 previous errors

A couple more that you'll need to rebase to address. Otherwise I think this is a good choice :)

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jan 17, 2020
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jan 17, 2020
Comment thread components/script/webdriver_handlers.rs Outdated
}

// https://w3c.github.io/webdriver/#dfn-center-point
#[allow(non_snake_case)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This one can be fully snake-cased; the violations are just variable names.

Comment thread components/script/script_runtime.rs Outdated
/// Implements the steps to compile webassembly response mentioned here
/// <https://webassembly.github.io/spec/web-api/#compile-a-potential-webassembly-response>
#[allow(unsafe_code)]
#[allow(unsafe_code, non_snake_case)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this one can be fully snake cased; the only violation I see is the parameter name _mimeType.

Comment thread components/script/fetch.rs Outdated

/// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
#[allow(non_snake_case)]
pub(crate) fn create_a_potential_CORS_request(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we usually leave "cors" lowercase, and can snake_case this

Comment thread components/script/dom/headers.rs Outdated
}

#[allow(non_snake_case)]
fn is_HTTP_whitespace(byte: u8) -> bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

http could be lowercase here

}

#[allow(non_snake_case)]
pub fn new(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be snake-case, it's just the parameter instanceID

}

#[allow(non_snake_case)]
pub fn new(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

like the above comment, just the instanceID parameter


// https://drafts.fxtf.org/geometry-1/#validate-and-fixup
#[allow(non_snake_case)]
pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Transform3D<f64>)> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this one's just the is2D local variable.

@pshaughn

Copy link
Copy Markdown
Contributor

Oh, I think I misunderstood the purpose of this commit! Those comments are still worth having somewhere to look at later, but they're not necessarily for this pr in particular.

@kunalmohan

Copy link
Copy Markdown
Contributor Author

I think I'll do it here itself. It shouldn't take much time at this stage.

@jdm

jdm commented Jan 19, 2020

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f7db4b7 has been approved by jdm

@highfive highfive assigned jdm and unassigned SimonSapin Jan 19, 2020
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jan 19, 2020
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f7db4b7 with merge e2bc874...

bors-servo pushed a commit that referenced this pull request Jan 19, 2020
Modify `script` to prevent further violations of snake_case

<!-- Please describe your changes on the following line: -->
Remove `#![allow(non_snake_case)]` from `script/lib.rs` and add `#[allow(non_snake_case)]` at each instance of violation.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25531  (GitHub issue number if applicable)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 19, 2020
@jdm

jdm commented Jan 20, 2020

Copy link
Copy Markdown
Member

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 20, 2020
@jdm

jdm commented Jan 20, 2020

Copy link
Copy Markdown
Member

@bors-servo retry

bors-servo pushed a commit that referenced this pull request Jan 20, 2020
Modify `script` to prevent further violations of snake_case

<!-- Please describe your changes on the following line: -->
Remove `#![allow(non_snake_case)]` from `script/lib.rs` and add `#[allow(non_snake_case)]` at each instance of violation.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25531  (GitHub issue number if applicable)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f7db4b7 with merge 28078bd...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 20, 2020
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 20, 2020
@CYBAI

CYBAI commented Jan 20, 2020

Copy link
Copy Markdown
Member

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f7db4b7 with merge 6b0e0a5...

bors-servo pushed a commit that referenced this pull request Jan 20, 2020
Modify `script` to prevent further violations of snake_case

<!-- Please describe your changes on the following line: -->
Remove `#![allow(non_snake_case)]` from `script/lib.rs` and add `#[allow(non_snake_case)]` at each instance of violation.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25531  (GitHub issue number if applicable)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 20, 2020
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 20, 2020
@CYBAI

CYBAI commented Jan 20, 2020

Copy link
Copy Markdown
Member

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f7db4b7 with merge 74d1f02...

bors-servo pushed a commit that referenced this pull request Jan 20, 2020
Modify `script` to prevent further violations of snake_case

<!-- Please describe your changes on the following line: -->
Remove `#![allow(non_snake_case)]` from `script/lib.rs` and add `#[allow(non_snake_case)]` at each instance of violation.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25531  (GitHub issue number if applicable)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 20, 2020
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 74d1f02 to master...

@bors-servo
bors-servo merged commit f7db4b7 into servo:master Jan 20, 2020
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 20, 2020
@kunalmohan
kunalmohan deleted the 25531-SnakeCase branch January 20, 2020 09:07
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.

Fix and disallow all snake_case style warnings

7 participants