Skip to content

Commit

Permalink
Forbid multiline imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wilcus committed Aug 25, 2015
1 parent f79220f commit 63851f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions components/script/dom/webglrenderingcontext.rs
Expand Up @@ -2,13 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use canvas_traits::
{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, WebGLError,
WebGLShaderParameter, WebGLFramebufferBindingRequest};
use canvas_traits::WebGLError::*;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::
{self, WebGLContextAttributes, WebGLRenderingContextMethods};
use canvas_traits::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, WebGLError};
use canvas_traits::{WebGLShaderParameter, WebGLFramebufferBindingRequest};
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{WebGLRenderingContextMethods};
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
use dom::bindings::codegen::InheritTypes::NodeCast;
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;

Expand Down
3 changes: 1 addition & 2 deletions python/tidy.py
Expand Up @@ -246,8 +246,7 @@ def is_associated_type(match, line, index):
# imports must be in the same line and alphabetically sorted
if line.startswith("use "):
use = line[4:]
match = use.find('{')
if match >= 0 and "}" not in use[match:]:
if not use.endswith(";"):
yield (idx + 1, "use statement spans multiple lines")
uses.append(use[:len(use) - 1])
elif len(uses) > 0:
Expand Down

0 comments on commit 63851f2

Please sign in to comment.