From 00cbda2d0af81a054ba61bd237f98e033ba7a2fa Mon Sep 17 00:00:00 2001 From: Boris Egorov Date: Mon, 7 Apr 2014 19:01:10 +0700 Subject: [PATCH] Improve searching for XXX in tidy script (#3303) Few places where previous version of tidy script cannot find XXX: * inside one-line comment preceding by a few spaces; * inside multiline comments (now it finds it if multiline comment starts on the same line with XXX). Change occurences of XXX found by new tidy script. --- src/etc/tidy.py | 5 +++-- src/librustuv/addrinfo.rs | 4 ++-- src/libstd/rt/local_ptr.rs | 2 +- src/test/bench/shootout-threadring.rs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/etc/tidy.py b/src/etc/tidy.py index 6529b4d084e..3d44c27a16e 100644 --- a/src/etc/tidy.py +++ b/src/etc/tidy.py @@ -65,10 +65,11 @@ try: check_tab = False if line.find(linelength_flag) != -1: check_linelength = False - if line.find("// XXX") != -1: - report_err("XXX is no longer necessary, use FIXME") if line.find("TODO") != -1: report_err("TODO is deprecated; use FIXME") + match = re.match(r'^.*/(\*|/!?)\s*XXX', line) + if match: + report_err("XXX is no longer necessary, use FIXME") match = re.match(r'^.*//\s*(NOTE.*)$', line) if match: m = match.group(1) diff --git a/src/librustuv/addrinfo.rs b/src/librustuv/addrinfo.rs index 7a23a3466da..1621435de55 100644 --- a/src/librustuv/addrinfo.rs +++ b/src/librustuv/addrinfo.rs @@ -120,7 +120,7 @@ impl Drop for Addrinfo { } fn each_ai_flag(_f: |c_int, ai::Flag|) { - /* XXX: do we really want to support these? + /* FIXME: do we really want to support these? unsafe { f(uvll::rust_AI_ADDRCONFIG(), ai::AddrConfig); f(uvll::rust_AI_ALL(), ai::All); @@ -150,7 +150,7 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] { } }); - /* XXX: do we really want to support these + /* FIXME: do we really want to support these let protocol = match (*addr).ai_protocol { p if p == uvll::rust_IPPROTO_UDP() => Some(ai::UDP), p if p == uvll::rust_IPPROTO_TCP() => Some(ai::TCP), diff --git a/src/libstd/rt/local_ptr.rs b/src/libstd/rt/local_ptr.rs index e486932ac3c..e3f64f40c0d 100644 --- a/src/libstd/rt/local_ptr.rs +++ b/src/libstd/rt/local_ptr.rs @@ -12,7 +12,7 @@ //! //! The runtime will use this for storing ~Task. //! -//! XXX: Add runtime checks for usage of inconsistent pointer types. +//! FIXME: Add runtime checks for usage of inconsistent pointer types. //! and for overwriting an existing pointer. #![allow(dead_code)] diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs index 7ee294b8e63..72d91ac645e 100644 --- a/src/test/bench/shootout-threadring.rs +++ b/src/test/bench/shootout-threadring.rs @@ -15,7 +15,7 @@ use std::os; fn start(n_tasks: int, token: int) { let (tx, mut rx) = channel(); tx.send(token); - // XXX could not get this to work with a range closure + // FIXME could not get this to work with a range closure let mut i = 2; while i <= n_tasks { let (tx, next_rx) = channel();