Skip to content
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

fixes #7390 : tidy now check the order of mod declarations even whith attribute #7680

Merged
merged 2 commits into from Sep 18, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -49,11 +49,11 @@ pub use constellation::Constellation;

pub mod compositor_task;

mod surface_map;
mod compositor_layer;
mod compositor;
mod compositor_layer;
mod headless;
mod scrolling;
mod surface_map;

pub mod pipeline;
pub mod constellation;
@@ -85,8 +85,8 @@ pub mod paint_task;

// Fonts
pub mod font;
pub mod font_context;
pub mod font_cache_task;
pub mod font_context;
pub mod font_template;

// Misc.
@@ -79,23 +79,23 @@ pub mod flow_list;
pub mod flow_ref;
pub mod fragment;
pub mod generated_content;
pub mod layout_task;
pub mod incremental;
pub mod inline;
pub mod layout_task;
pub mod list_item;
pub mod model;
pub mod multicol;
pub mod opaque_node;
pub mod parallel;
pub mod query;
pub mod sequential;
pub mod table_wrapper;
pub mod table;
pub mod table_caption;
pub mod table_cell;
pub mod table_colgroup;
pub mod table_rowgroup;
pub mod table_row;
pub mod table_cell;
pub mod table_rowgroup;
pub mod table_wrapper;
pub mod text;
pub mod traversal;
pub mod wrapper;
@@ -27,22 +27,22 @@ extern crate url;
extern crate uuid;

pub mod about_loader;
pub mod file_loader;
pub mod http_loader;
pub mod data_loader;
pub mod cookie;
pub mod cookie_storage;
pub mod data_loader;
pub mod file_loader;
pub mod hsts;
pub mod http_loader;
pub mod image_cache_task;
pub mod mime_classifier;
pub mod pub_domains;
pub mod resource_task;
pub mod hsts;
pub mod storage_task;
pub mod mime_classifier;

/// An implementation of the [Fetch spec](https://fetch.spec.whatwg.org/)
pub mod fetch {
#![allow(dead_code, unused)] // XXXManishearth this is only temporary until the Fetch mod starts being used
pub mod cors_cache;
pub mod request;
pub mod response;
pub mod cors_cache;
}
@@ -37,11 +37,11 @@ pub mod jstraceable;
/// Handles the auto-deriving for `#[derive(HeapSizeOf)]`
pub mod heap_size;
/// Autogenerates implementations of Reflectable on DOM structs
pub mod reflector;
pub mod lints;
pub mod reflector;
/// Utilities for writing plugins
pub mod utils;
pub mod casing;
pub mod utils;

#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
@@ -135,19 +135,19 @@
#![allow(unsafe_code)]
#![deny(missing_docs, non_snake_case)]

pub mod callback;
pub mod cell;
pub mod conversions;
pub mod error;
pub mod global;
pub mod js;
pub mod refcounted;
pub mod utils;
pub mod callback;
pub mod error;
pub mod conversions;
pub mod proxyhandler;
pub mod num;
pub mod proxyhandler;
pub mod refcounted;
pub mod str;
pub mod structuredclone;
pub mod trace;
pub mod utils;

/// Generated JS-Rust bindings.
#[allow(missing_docs, non_snake_case)]
@@ -179,4 +179,3 @@ pub mod codegen {
include!(concat!(env!("OUT_DIR"), "/UnionTypes.rs"));
}
}

@@ -199,18 +199,13 @@ pub mod canvasgradient;
pub mod canvaspattern;
pub mod canvasrenderingcontext2d;
pub mod characterdata;
pub mod css;
pub mod cssstyledeclaration;
pub mod dompoint;
pub mod dompointreadonly;
pub mod domrect;
pub mod domrectlist;
pub mod domstringmap;
pub mod closeevent;
pub mod comment;
pub mod console;
mod create;
pub mod crypto;
pub mod css;
pub mod cssstyledeclaration;
pub mod customevent;
pub mod dedicatedworkerglobalscope;
pub mod document;
@@ -219,6 +214,11 @@ pub mod documenttype;
pub mod domexception;
pub mod domimplementation;
pub mod domparser;
pub mod dompoint;
pub mod dompointreadonly;
pub mod domrect;
pub mod domrectlist;
pub mod domstringmap;
pub mod domtokenlist;
pub mod element;
pub mod errorevent;
@@ -280,15 +280,15 @@ pub mod htmlprogresselement;
pub mod htmlquoteelement;
pub mod htmlscriptelement;
pub mod htmlselectelement;
pub mod htmlspanelement;
pub mod htmlsourceelement;
pub mod htmlspanelement;
pub mod htmlstyleelement;
pub mod htmltableelement;
pub mod htmltablecaptionelement;
pub mod htmltablecellelement;
pub mod htmltablecolelement;
pub mod htmltabledatacellelement;
pub mod htmltableelement;
pub mod htmltableheadercellelement;
pub mod htmltablecolelement;
pub mod htmltablerowelement;
pub mod htmltablesectionelement;
pub mod htmltemplateelement;
@@ -297,8 +297,8 @@ pub mod htmltimeelement;
pub mod htmltitleelement;
pub mod htmltrackelement;
pub mod htmlulistelement;
pub mod htmlvideoelement;
pub mod htmlunknownelement;
pub mod htmlvideoelement;
pub mod imagedata;
pub mod keyboardevent;
pub mod location;
@@ -310,9 +310,9 @@ pub mod navigatorinfo;
pub mod node;
pub mod nodeiterator;
pub mod nodelist;
pub mod processinginstruction;
pub mod performance;
pub mod performancetiming;
pub mod processinginstruction;
pub mod progressevent;
pub mod range;
pub mod screen;
@@ -330,17 +330,17 @@ pub mod urlsearchparams;
pub mod userscripts;
pub mod validitystate;
pub mod virtualmethods;
pub mod webglobject;
pub mod webglactiveinfo;
pub mod webglbuffer;
pub mod webglframebuffer;
pub mod webglobject;
pub mod webglprogram;
pub mod webglrenderbuffer;
pub mod webglrenderingcontext;
pub mod webglshader;
pub mod webgluniformlocation;
pub mod webgltexture;
pub mod webglframebuffer;
pub mod webglrenderbuffer;
pub mod webglactiveinfo;
pub mod webglshaderprecisionformat;
pub mod webgltexture;
pub mod webgluniformlocation;
pub mod websocket;
pub mod window;
pub mod worker;
@@ -91,16 +91,16 @@ pub mod dom;

pub mod parse;

pub mod clipboard_provider;
mod devtools;
mod horribly_inefficient_timers;
pub mod layout_interface;
mod mem;
mod network_listener;
pub mod page;
pub mod script_task;
mod timers;
pub mod textinput;
pub mod clipboard_provider;
mod devtools;
mod horribly_inefficient_timers;
mod timers;
mod webdriver_handlers;

use dom::bindings::codegen::RegisterBindings;
@@ -47,9 +47,9 @@ extern crate util;
extern crate style_traits;

mod custom_properties;
pub mod stylesheets;
pub mod parser;
pub mod selector_matching;
pub mod stylesheets;
#[macro_use] pub mod values;

// Generated from the properties.mako.rs template by build.rs
@@ -58,11 +58,11 @@ pub mod properties {
include!(concat!(env!("OUT_DIR"), "/properties.rs"));
}

pub mod node;
pub mod media_queries;
pub mod animation;
pub mod font_face;
pub mod legacy;
pub mod animation;
pub mod media_queries;
pub mod node;
pub mod viewport;

macro_rules! reexport_computed_values {
@@ -53,9 +53,9 @@ pub mod cache;
pub mod cursor;
pub mod debug_utils;
pub mod deque;
pub mod linked_list;
pub mod geometry;
pub mod ipc;
pub mod linked_list;
pub mod logical_geometry;
pub mod mem;
pub mod opts;
@@ -66,9 +66,9 @@ pub mod range;
pub mod resource_files;
pub mod str;
pub mod task;
pub mod tid;
pub mod taskpool;
pub mod task_state;
pub mod taskpool;
pub mod tid;
pub mod vec;
pub mod workqueue;

@@ -51,8 +51,8 @@ use util::opts;

use std::env;

mod window;
mod input;
mod window;

struct BrowserWrapper {
browser: Browser,
@@ -105,4 +105,3 @@ fn main() {
} = browser;
browser.shutdown();
}

@@ -203,6 +203,8 @@ def check_rust(file_name, contents):

uses = []

mods = []

for idx, line in enumerate(contents):
# simplify the analysis
line = line.strip()
@@ -305,6 +307,29 @@ def check_rust(file_name, contents):
yield (idx + 1 - len(uses) + i, message + expected + found)
uses = []

# modules must be in the same line and alphabetically sorted
if line.startswith("mod ") or line.startswith("pub mod "):
mod = ""
if line.startswith("mod "):
mod = line[4:]
else:
mod = line[8:]

match = line.find(" {")
if match == -1:
if not mod.endswith(";"):
yield (idx + 1, "mod statement spans multiple lines")
mods.append(mod[:len(mod) - 1])
elif len(mods) > 0:
sorted_mods = sorted(mods)
for i in range(len(mods)):
if sorted_mods[i] != mods[i]:
message = "mod statement is not in alphabetical order"
expected = "\n\t\033[93mexpected: {}\033[0m".format(sorted_mods[i])
found = "\n\t\033[91mfound: {}\033[0m".format(mods[i])
yield (idx + 1 - len(mods) + i, message + expected + found)
mods = []


# Avoid flagging <Item=Foo> constructs
def is_associated_type(match, line, index):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.