Auto merge of #8692 - GuillaumeGomez:patch-1, r=Wafflespeanut

Ensure crate are alphabetically sorted

cc @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8692)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-28 19:34:11 +05:30
commit dbff1ab336
22 changed files with 111 additions and 108 deletions

View file

@ -9,8 +9,6 @@
#![feature(plugin)]
#![plugin(plugins)]
#[macro_use]
extern crate log;
extern crate azure;
extern crate canvas_traits;
extern crate core;
@ -20,6 +18,8 @@ extern crate gfx_traits;
extern crate gleam;
extern crate ipc_channel;
extern crate layers;
#[macro_use]
extern crate log;
extern crate num;
extern crate offscreen_gl_context;
extern crate util;

View file

@ -16,22 +16,15 @@
#![plugin(serde_macros)]
extern crate app_units;
#[macro_use]
extern crate log;
#[macro_use]
extern crate profile_traits;
#[macro_use]
extern crate util;
extern crate azure;
extern crate canvas;
extern crate canvas_traits;
extern crate clipboard;
#[cfg(target_os = "macos")]
extern crate core_graphics;
#[cfg(target_os = "macos")]
extern crate core_text;
extern crate devtools_traits;
extern crate euclid;
extern crate gaol;
@ -42,17 +35,22 @@ extern crate image;
extern crate ipc_channel;
extern crate layers;
extern crate layout_traits;
extern crate libc;
#[macro_use]
extern crate log;
extern crate msg;
extern crate net_traits;
extern crate num;
extern crate offscreen_gl_context;
#[macro_use]
extern crate profile_traits;
extern crate script_traits;
extern crate serde;
extern crate style_traits;
extern crate libc;
extern crate time;
extern crate url;
#[macro_use]
extern crate util;
pub use compositor_task::{CompositorEventListener, CompositorProxy, CompositorTask};
pub use constellation::Constellation;

View file

@ -19,11 +19,11 @@
#![allow(non_snake_case)]
#![deny(unsafe_code)]
#[macro_use]
extern crate log;
extern crate devtools_traits;
extern crate hyper;
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate msg;
extern crate rustc_serialize;
extern crate serde;

View file

@ -20,19 +20,11 @@
#![plugin(plugins)]
#![plugin(serde_macros)]
extern crate alloc;
extern crate app_units;
extern crate azure;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
#[macro_use]
extern crate profile_traits;
#[macro_use]
extern crate util;
extern crate alloc;
extern crate azure;
extern crate canvas_traits;
// Mac OS-specific library dependencies
@ -57,9 +49,15 @@ extern crate harfbuzz_sys as harfbuzz;
extern crate ipc_channel;
extern crate layers;
#[macro_use]
extern crate lazy_static;
extern crate libc;
#[macro_use]
extern crate log;
extern crate msg;
extern crate net_traits;
#[macro_use]
extern crate profile_traits;
extern crate rand;
extern crate rustc_serialize;
extern crate script_traits;
@ -75,6 +73,8 @@ extern crate style;
extern crate time;
extern crate unicode_script;
extern crate url;
#[macro_use]
extern crate util;
pub use paint_context::PaintContext;

View file

@ -19,18 +19,9 @@
#![plugin(plugins)]
extern crate app_units;
extern crate azure;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate log;
#[macro_use]
extern crate profile_traits;
#[macro_use]
#[no_link]
extern crate plugins as servo_plugins;
#[macro_use]
extern crate util;
extern crate azure;
extern crate canvas_traits;
extern crate clock_ticks;
extern crate cssparser;
@ -42,8 +33,15 @@ extern crate gfx_traits;
extern crate ipc_channel;
extern crate layout_traits;
extern crate libc;
#[macro_use]
extern crate log;
extern crate msg;
extern crate net_traits;
#[macro_use]
#[no_link]
extern crate plugins as servo_plugins;
#[macro_use]
extern crate profile_traits;
extern crate rustc_serialize;
extern crate script;
extern crate script_traits;
@ -57,6 +55,8 @@ extern crate style_traits;
extern crate unicode_bidi;
extern crate unicode_script;
extern crate url;
#[macro_use]
extern crate util;
#[macro_use]
mod layout_debug;

View file

@ -8,10 +8,10 @@
extern crate euclid;
extern crate gfx;
extern crate ipc_channel;
extern crate script_traits;
extern crate msg;
extern crate profile_traits;
extern crate net_traits;
extern crate profile_traits;
extern crate script_traits;
extern crate serde;
extern crate url;
extern crate util;

View file

@ -6,9 +6,9 @@
#![plugin(serde_macros, plugins)]
extern crate app_units;
extern crate azure;
#[macro_use]
extern crate bitflags;
extern crate azure;
extern crate canvas_traits;
#[cfg(target_os = "macos")]
extern crate core_foundation;

View file

@ -11,15 +11,15 @@
#![feature(plugin)]
#![plugin(plugins)]
#[macro_use]
extern crate log;
extern crate brotli;
extern crate cookie as cookie_rs;
extern crate devtools_traits;
extern crate euclid;
extern crate flate2;
extern crate brotli;
extern crate hyper;
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate mime_guess;
extern crate msg;
extern crate net_traits;

View file

@ -12,12 +12,12 @@
#![feature(custom_attribute)]
#![plugin(serde_macros, plugins)]
#[macro_use]
extern crate log;
extern crate euclid;
extern crate hyper;
extern crate ipc_channel;
extern crate image as piston_image;
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate msg;
extern crate serde;
extern crate stb_image;

View file

@ -15,16 +15,14 @@
#![feature(plugin_registrar, quote, plugin, box_syntax, rustc_private, slice_patterns)]
#[macro_use]
extern crate syntax;
#[macro_use]
extern crate rustc;
extern crate rustc_front;
extern crate tenacious;
#[cfg(feature = "clippy")]
extern crate clippy;
#[macro_use]
extern crate rustc;
extern crate rustc_front;
#[macro_use]
extern crate syntax;
extern crate tenacious;
extern crate url;

View file

@ -9,20 +9,19 @@
#![feature(plugin)]
#![plugin(plugins)]
#[macro_use]
extern crate log;
#[macro_use]
extern crate profile_traits;
extern crate alloc_jemalloc;
extern crate hbs_pow;
extern crate ipc_channel;
extern crate libc;
#[macro_use]
extern crate log;
#[macro_use]
extern crate profile_traits;
#[cfg(target_os = "linux")]
extern crate regex;
extern crate time as std_time;
#[cfg(target_os = "macos")]
extern crate task_info;
extern crate time as std_time;
extern crate util;
mod heartbeats;

View file

@ -25,8 +25,8 @@ pub fn energy_interval_ms() -> u32 {
#[cfg(feature = "energy-profiling")]
mod energymon {
extern crate energymon;
extern crate energy_monitor;
extern crate energymon;
use self::energy_monitor::EnergyMonitor;
use self::energymon::EnergyMon;

View file

@ -33,19 +33,10 @@
#![plugin(plugins)]
extern crate angle;
extern crate app_units;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate log;
#[macro_use]
extern crate profile_traits;
#[macro_use]
extern crate style;
extern crate style_traits;
#[macro_use]
extern crate util;
extern crate angle;
extern crate canvas;
extern crate canvas_traits;
extern crate caseless;
@ -61,10 +52,14 @@ extern crate image;
extern crate ipc_channel;
extern crate js;
extern crate libc;
#[macro_use]
extern crate log;
extern crate msg;
extern crate net_traits;
extern crate num;
extern crate offscreen_gl_context;
#[macro_use]
extern crate profile_traits;
extern crate rand;
extern crate rustc_serialize;
extern crate rustc_unicode;
@ -73,10 +68,15 @@ extern crate script_traits;
extern crate serde;
extern crate smallvec;
#[macro_use(atom, ns)] extern crate string_cache;
#[macro_use]
extern crate style;
extern crate style_traits;
extern crate tendril;
extern crate time;
extern crate unicase;
extern crate url;
#[macro_use]
extern crate util;
extern crate uuid;
extern crate websocket;

View file

@ -18,7 +18,7 @@
// `WindowMethods` trait.
extern crate gaol;
extern crate libc;
#[macro_use]
extern crate util as _util;
@ -45,8 +45,6 @@ mod export {
extern crate url;
}
extern crate libc;
#[cfg(feature = "webdriver")]
extern crate webdriver_server;

View file

@ -20,20 +20,19 @@
#[cfg(target_os = "android")]
#[macro_use]
extern crate android_glue;
extern crate env_logger;
extern crate gleam;
// The window backed by glutin
extern crate glutin_app as app;
extern crate env_logger;
#[cfg(target_os = "android")]
extern crate libc;
#[macro_use]
extern crate log;
extern crate offscreen_gl_context;
// The Servo engine
extern crate servo;
extern crate time;
extern crate gleam;
extern crate offscreen_gl_context;
use gleam::gl;
use offscreen_gl_context::GLContext;
use servo::Browser;
@ -222,8 +221,8 @@ android_start!(main);
#[cfg(target_os = "android")]
mod android {
extern crate libc;
extern crate android_glue;
extern crate libc;
use self::libc::c_int;
use std::borrow::ToOwned;

View file

@ -20,23 +20,23 @@ extern crate app_units;
extern crate bitflags;
#[macro_use]
extern crate cssparser;
extern crate encoding;
extern crate euclid;
extern crate fnv;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
#[macro_use]
extern crate matches;
#[macro_use]
extern crate style_traits;
extern crate encoding;
extern crate euclid;
extern crate fnv;
extern crate num;
extern crate rustc_serialize;
#[macro_use(state_pseudo_classes)] extern crate selectors;
extern crate serde;
extern crate smallvec;
#[macro_use(atom, ns)] extern crate string_cache;
#[macro_use]
extern crate style_traits;
extern crate url;
extern crate util;

View file

@ -20,17 +20,13 @@
#![plugin(plugins, serde_macros)]
extern crate alloc;
extern crate app_units;
extern crate azure;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate cssparser;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate alloc;
extern crate azure;
extern crate euclid;
extern crate getopts;
extern crate html5ever;
@ -38,9 +34,13 @@ extern crate hyper;
extern crate ipc_channel;
extern crate js;
extern crate layers;
#[macro_use]
extern crate lazy_static;
extern crate libc;
extern crate num_cpus;
#[macro_use]
extern crate log;
extern crate num as num_lib;
extern crate num_cpus;
extern crate rand;
extern crate rustc_serialize;
extern crate selectors;

View file

@ -8,11 +8,11 @@
#![feature(ip_addr, plugin)]
#![plugin(plugins)]
#[macro_use]
extern crate log;
extern crate hyper;
extern crate image;
extern crate ipc_channel;
#[macro_use]
extern crate log;
extern crate msg;
extern crate regex;
extern crate rustc_serialize;

View file

@ -9,6 +9,7 @@
#[macro_use] extern crate bitflags;
#[cfg(target_os = "macos")] extern crate cgl;
extern crate compositing;
#[cfg(target_os = "android")] extern crate egl;
extern crate euclid;
extern crate gleam;
extern crate glutin;
@ -18,9 +19,8 @@ extern crate msg;
extern crate net_traits;
#[cfg(feature = "window")] extern crate script_traits;
extern crate time;
extern crate util;
#[cfg(target_os = "android")] extern crate egl;
extern crate url;
extern crate util;
#[cfg(target_os = "linux")] extern crate x11;
use compositing::windowing::WindowEvent;

View file

@ -23,23 +23,21 @@
//!
//! [glutin]: https://github.com/tomaka/glutin
extern crate servo;
extern crate time;
extern crate util;
extern crate errno;
extern crate compositing;
extern crate script_traits;
extern crate egl;
extern crate env_logger;
extern crate errno;
extern crate euclid;
extern crate libc;
extern crate msg;
extern crate gleam;
extern crate layers;
extern crate egl;
extern crate url;
extern crate libc;
extern crate msg;
extern crate net_traits;
extern crate env_logger;
extern crate script_traits;
extern crate servo;
extern crate time;
extern crate url;
extern crate util;
#[link(name = "stlport")]
extern {}

View file

@ -221,12 +221,25 @@ def check_rust(file_name, contents):
whitespace = False
uses = []
prev_crate = {}
mods = []
for idx, line in enumerate(contents):
for idx, original_line in enumerate(contents):
# simplify the analysis
line = line.strip()
line = original_line.strip()
# check extern crates
if line.startswith("extern crate"):
crate_name = line.replace("extern crate ", "").replace(";", "")
indent = len(original_line) - len(line)
if indent not in prev_crate:
prev_crate[indent] = ""
if prev_crate[indent] > crate_name:
message = "extern crate statement is not in alphabetical order"
expected = "\n\t\033[93mexpected: {}\033[0m".format(prev_crate[indent])
found = "\n\t\033[91mfound: {}\033[0m".format(crate_name)
yield(idx + 1, message + expected + found)
prev_crate[indent] = crate_name
# Simple heuristic to avoid common case of no comments.
if '/' in line:

View file

@ -2,8 +2,8 @@
* 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/. */
extern crate script;
extern crate msg;
extern crate script;
extern crate util;
#[cfg(all(test, target_pointer_width = "64"))] mod size_of;