Update of /cvsroot/boost/boost/tools/inspect
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28472/tools/inspect
Modified Files:
copyright_check.cpp copyright_check.hpp crlf_check.cpp
crlf_check.hpp inspect.cpp license_check.cpp license_check.hpp
link_check.cpp link_check.hpp long_name_check.cpp
long_name_check.hpp minmax_check.cpp minmax_check.hpp
run_inspect.sh tab_check.cpp tab_check.hpp
Log Message:
Shorten the output somewhat by using short keys instead of full explanations
for some items. Add tags to turn off content based tests. Split the test
reports into two parts, license+copyright and everything else.
Index: copyright_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/copyright_check.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- copyright_check.cpp 20 Jul 2004 04:31:53 -0000 1.8
+++ copyright_check.cpp 16 Jul 2006 16:15:28 -0000 1.9
@@ -20,11 +20,13 @@
const path & full_path, // example: c:/foo/boost/filesystem/path.hpp
const string & contents ) // contents of file to be inspected
{
+ if (contents.find( "boostinspect:nocopyright" ) != string::npos) return;
+
if ( contents.find( "Copyright" ) == string::npos
&& contents.find( "copyright" ) == string::npos )
{
++m_files_with_errors;
- error( library_name, full_path, desc() );
+ error( library_name, full_path, name() );
}
}
} // namespace inspect
Index: copyright_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/copyright_check.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- copyright_check.hpp 20 Jul 2004 04:31:53 -0000 1.4
+++ copyright_check.hpp 16 Jul 2006 16:15:28 -0000 1.5
@@ -21,7 +21,7 @@
public:
copyright_check();
- virtual const char * name() const { return "copyright-check"; }
+ virtual const char * name() const { return "*C*"; }
virtual const char * desc() const { return "missing copyright"; }
virtual void inspect(
Index: crlf_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/crlf_check.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- crlf_check.cpp 14 Jul 2005 16:34:11 -0000 1.7
+++ crlf_check.cpp 16 Jul 2006 16:15:28 -0000 1.8
@@ -22,6 +22,8 @@
const path & full_path, // example: c:/foo/boost/filesystem/path.hpp
const string & contents ) // contents of file to be inspected
{
+ if (contents.find( "boostinspect:nocrlf" ) != string::npos) return;
+
bool failed = false;
// The understanding on line endings, as I remember it, was that
// either "\n" or "\r\n" is OK, and they can be mixed, but "\r" alone
@@ -46,7 +48,7 @@
if (failed && full_path.leaf() != "wrong_line_ends_test.cpp")
{
++m_files_with_errors;
- error( library_name, full_path, desc() );
+ error( library_name, full_path, name() );
}
if (!failed && full_path.leaf() == "wrong_line_ends_test.cpp")
Index: crlf_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/crlf_check.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crlf_check.hpp 20 Jul 2004 04:31:53 -0000 1.4
+++ crlf_check.hpp 16 Jul 2006 16:15:28 -0000 1.5
@@ -23,7 +23,7 @@
public:
crlf_check();
- virtual const char * name() const { return "crlf-check"; }
+ virtual const char * name() const { return "*R*"; }
virtual const char * desc() const { return "invalid (cr only)
line-ending"; }
virtual void inspect(
Index: inspect.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/inspect.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- inspect.cpp 15 Jul 2006 22:35:31 -0000 1.17
+++ inspect.cpp 16 Jul 2006 16:15:28 -0000 1.18
@@ -282,8 +282,6 @@
{
if (display_text == display_format)
{
- std::cout << "Details:\n";
-
// display error messages with group indication
error_msg current;
string sep;
@@ -319,8 +317,6 @@
}
else
{
- std::cout << "<h2>Details</h2>\n";
-
// display error messages with group indication
error_msg current;
string sep;
@@ -648,9 +644,24 @@
std::cout << "\nproblem counts:\n";
}
+ string inspector_keys;
for ( inspector_list::iterator itr = inspectors.begin();
itr != inspectors.end(); ++itr )
{
+ if (display_text == display_format)
+ {
+ inspector_keys += (
+ boost::format(" %1% %2%\n")
+ % itr->inspector->name() % itr->inspector->desc()
+ ).str();
+ }
+ else
+ {
+ inspector_keys += (
+ boost::format(" %1% %2%</br>\n")
+ % itr->inspector->name() % itr->inspector->desc()
+ ).str();
+ }
itr->inspector.reset();
}
@@ -664,6 +675,15 @@
if ( !msgs.empty() )
{
display_summary();
+
+ if (display_text == display_format)
+ {
+ std::cout << "Details:\n" << inspector_keys;
+ }
+ else
+ {
+ std::cout << "<h2>Details</h2>\n" << inspector_keys;
+ }
display_details();
}
Index: license_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/license_check.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- license_check.cpp 20 Jul 2004 04:31:53 -0000 1.3
+++ license_check.cpp 16 Jul 2006 16:15:29 -0000 1.4
@@ -29,10 +29,12 @@
const path & full_path, // example: c:/foo/boost/filesystem/path.hpp
const string & contents ) // contents of file to be inspected
{
+ if (contents.find( "boostinspect:nolicense" ) != string::npos) return;
+
if ( !boost::regex_search( contents, license_regex ) )
{
++m_files_with_errors;
- error( library_name, full_path, desc() );
+ error( library_name, full_path, name() );
}
}
} // namespace inspect
Index: license_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/license_check.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- license_check.hpp 20 Jul 2004 04:31:53 -0000 1.2
+++ license_check.hpp 16 Jul 2006 16:15:29 -0000 1.3
@@ -21,7 +21,7 @@
public:
license_check();
- virtual const char * name() const { return "license-check"; }
+ virtual const char * name() const { return "*L*"; }
virtual const char * desc() const { return "missing Boost license info";
}
virtual void inspect(
Index: link_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/link_check.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- link_check.cpp 5 Oct 2004 15:19:14 -0000 1.13
+++ link_check.cpp 16 Jul 2006 16:15:29 -0000 1.14
@@ -52,6 +52,8 @@
const path & full_path, // example: c:/foo/boost/filesystem/path.hpp
const string & contents ) // contents of file to be inspected
{
+ if (contents.find( "boostinspect:nolink" ) != string::npos) return;
+
string::const_iterator start( contents.begin() );
string::const_iterator end( contents.end() );
boost::match_results< string::const_iterator > what;
@@ -87,7 +89,7 @@
if ( url.find( "file:" ) == 0 )
{
++m_invalid_errors;
- error( library_name, source_path, "invalid URL (hardwired file): " +
url );
+ error( library_name, source_path, string(name()) + " invalid URL
(hardwired file): " + url );
return;
}
@@ -95,7 +97,7 @@
if ( url.find_first_of( " <>\"{}|\\^[]'" ) != string::npos )
{
++m_invalid_errors;
- error( library_name, source_path, "invalid character in URL: " + url );
+ error( library_name, source_path, string(name()) + " invalid character
in URL: " + url );
}
// strip url of bookmarks
@@ -108,7 +110,7 @@
if ( url.find( '#', pos+1 ) != string::npos )
{
++m_bookmark_errors;
- error( library_name, source_path, "invalid bookmark: " + url );
+ error( library_name, source_path, string(name()) + " invalid
bookmark: " + url );
}
}
@@ -122,7 +124,7 @@
catch ( const fs::filesystem_error & )
{
++m_invalid_errors;
- error( library_name, source_path, "invalid URL: " + url );
+ error( library_name, source_path, string(name()) + " invalid URL: " +
url );
return;
}
@@ -143,7 +145,7 @@
if ( (itr->second & m_present) == 0 )
{
++m_broken_errors;
- error( library_name, source_path, "broken link: " + url );
+ error( library_name, source_path, string(name()) + " broken link: " +
url );
}
}
@@ -164,7 +166,7 @@
{
++m_unlinked_errors;
path full_path( fs::initial_path() / path(itr->first, fs::no_check) );
- error( impute_library( full_path ), full_path, "unlinked file" );
+ error( impute_library( full_path ), full_path, string(name()) + "
unlinked file" );
}
}
}
Index: link_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/link_check.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- link_check.hpp 20 Jul 2004 04:31:53 -0000 1.4
+++ link_check.hpp 16 Jul 2006 16:15:29 -0000 1.5
@@ -36,7 +36,7 @@
public:
link_check();
- virtual const char * name() const { return "link-check"; }
+ virtual const char * name() const { return "*A*"; }
virtual const char * desc() const { return "invalid bookmarks, invalid
urls, broken links, unlinked files"; }
virtual void inspect(
Index: long_name_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/long_name_check.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- long_name_check.cpp 14 Jul 2005 16:34:12 -0000 1.9
+++ long_name_check.cpp 16 Jul 2006 16:15:29 -0000 1.10
@@ -48,19 +48,19 @@
if ( leaf.size() > 31 )
{
++m_long_name_errors;
- error( library_name, full_path, "filename > 31 chars" );
+ error( library_name, full_path, string(name()) + " filename > 31
chars" );
}
if ( std::count( leaf.begin(), leaf.end(), '.' ) > 1 )
{
++m_long_name_errors;
- error( library_name, full_path, "filename contains more than one dot
character ('.')" );
+ error( library_name, full_path, string(name()) + " filename contains
more than one dot character ('.')" );
}
if ( *leaf.rbegin() == '.' )
{
++m_long_name_errors;
- error( library_name, full_path, "filename ends with the dot character
('.')" );
+ error( library_name, full_path, string(name()) + " filename ends with
the dot character ('.')" );
}
path const relative_path( relative_to( full_path,
filesystem::initial_path() ), &filesystem::no_check );
@@ -69,26 +69,26 @@
!= relative_path.end() )
{
++m_long_name_errors;
- error( library_name, full_path, "leading character of one of the path
compontents is not alphabetic" );
+ error( library_name, full_path, string(name()) + " leading character
of one of the path compontents is not alphabetic" );
}
if ( std::find_if( relative_path.begin(), boost::prior(
relative_path.end() )
, boost::bind( &aux::contains_dot, _1 ) ) != boost::prior(
relative_path.end() ) )
{
++m_long_name_errors;
- error( library_name, full_path, "directory name contains the dot
character ('.')" );
+ error( library_name, full_path, string(name()) + " directory name
contains the dot character ('.')" );
}
if ( std::distance( relative_path.begin(), boost::prior(
relative_path.end() ) ) >= 8 )
{
++m_long_name_errors;
- error( library_name, full_path, "file's directory depth will exceed 8
levels if placed on a CD" );
+ error( library_name, full_path, string(name()) + " file's directory
depth will exceed 8 levels if placed on a CD" );
}
if ( relative_path.string().size() > ( 100 - string( "boost_X_XX_X/"
).size() ) )
{
++m_long_name_errors;
- error( library_name, full_path, "file path will be > 100 chars if
placed on a CD" );
+ error( library_name, full_path, string(name()) + " file path will be >
100 chars if placed on a CD" );
}
if (relative_path.leaf() != ".cvsignore")
@@ -100,7 +100,7 @@
catch ( filesystem::filesystem_error const& )
{
++m_long_name_errors;
- error( library_name, full_path, "nonportable path" );
+ error( library_name, full_path, string(name()) + " nonportable path"
);
}
}
}
Index: long_name_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/long_name_check.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- long_name_check.hpp 20 Jul 2004 04:31:53 -0000 1.4
+++ long_name_check.hpp 16 Jul 2006 16:15:29 -0000 1.5
@@ -21,7 +21,7 @@
long_name_check();
virtual ~long_name_check();
- virtual const char * name() const { return "long-name-check"; }
+ virtual const char * name() const { return "*N*"; }
virtual const char * desc() const { return "file names too long"; }
virtual void inspect(
Index: minmax_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/minmax_check.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- minmax_check.cpp 8 Feb 2005 18:52:36 -0000 1.1
+++ minmax_check.cpp 16 Jul 2006 16:15:29 -0000 1.2
@@ -46,6 +46,8 @@
const path & full_path, // example: c:/foo/boost/filesystem/path.hpp
const string & contents) // contents of file to be inspected
{
+ if (contents.find( "boostinspect:nominmax" ) != string::npos) return;
+
boost::sregex_iterator cur(contents.begin(), contents.end(),
minmax_regex), end;
for( ; cur != end; ++cur, ++m_errors )
@@ -53,8 +55,8 @@
std::string linenbr = boost::lexical_cast<string>(
std::count( contents.begin(), (*cur)[0].first, '\n' ) + 1);
- error( library_name, full_path, "violation of Boost min/max guidelines
on line " + linenbr );
- }
+ error( library_name, full_path, string(name()) + " violation of Boost
min/max guidelines on line " + linenbr );
+ }
}
} // namespace inspect
Index: minmax_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/minmax_check.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- minmax_check.hpp 8 Feb 2005 18:52:36 -0000 1.1
+++ minmax_check.hpp 16 Jul 2006 16:15:29 -0000 1.2
@@ -22,7 +22,7 @@
public:
minmax_check();
- virtual const char * name() const { return "minmax-check"; }
+ virtual const char * name() const { return "*M*"; }
virtual const char * desc() const { return "uses of min and max that
have not been protected from the min/max macros"; }
virtual void inspect(
Index: run_inspect.sh
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/run_inspect.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- run_inspect.sh 15 Jul 2006 23:50:44 -0000 1.3
+++ run_inspect.sh 16 Jul 2006 16:15:29 -0000 1.4
@@ -30,15 +30,33 @@
#~ Run the inspection.
cd ${cvs_dir}
cd boost_${cvs_branch}
-./dist/bin/inspect -text -license -copyright -crlf -link -long_name -tab
-minmax > inspect-out.txt
+opt=""
+opt="${opt} -crlf"
+opt="${opt} -link"
+opt="${opt} -long_name"
+opt="${opt} -tab"
+opt="${opt} -minmax"
+./dist/bin/inspect -text ${opt} > inspect-X.out
+opt=""
+opt="${opt} -license"
+opt="${opt} -copyright"
+./dist/bin/inspect -text ${opt} > inspect-LC.out
-#~ Send email with results.
+#~ Send email(s) with results.
mail_date=`date --iso-8601 --utc`
/usr/sbin/sendmail "${mail_to}" <<EMAIL
From: ${mail_from}
To: ${mail_to}
Reply-To: ${mail_to}
-Subject: Boost inspection notification (${mail_date}/${cvs_branch})
+Subject: Boost inspection notification (${mail_date}/${cvs_branch}) *X*
-`cat inspect-out.txt`
+`cat inspect-X.out`
+EMAIL
+/usr/sbin/sendmail "${mail_to}" <<EMAIL
+From: ${mail_from}
+To: ${mail_to}
+Reply-To: ${mail_to}
+Subject: Boost inspection notification (${mail_date}/${cvs_branch}) *LC*
+
+`cat inspect-LC.out`
EMAIL
Index: tab_check.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/tab_check.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- tab_check.cpp 18 May 2005 18:42:58 -0000 1.7
+++ tab_check.cpp 16 Jul 2006 16:15:29 -0000 1.8
@@ -29,11 +29,12 @@
const path & full_path, // example: c:/foo/boost/filesystem/path.hpp
const string & contents ) // contents of file to be inspected
{
- if ( contents.find( '\t' ) != string::npos &&
- contents.find( "boostinspect:notab" ) == string::npos)
+ if (contents.find( "boostinspect:notab" ) != string::npos) return;
+
+ if ( contents.find( '\t' ) != string::npos )
{
++m_files_with_errors;
- error( library_name, full_path, desc() );
+ error( library_name, full_path, name() );
}
}
} // namespace inspect
Index: tab_check.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/inspect/tab_check.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- tab_check.hpp 20 Jul 2004 04:31:53 -0000 1.4
+++ tab_check.hpp 16 Jul 2006 16:15:29 -0000 1.5
@@ -20,7 +20,7 @@
public:
tab_check();
- virtual const char * name() const { return "tab-check"; }
+ virtual const char * name() const { return "*T*"; }
virtual const char * desc() const { return "tabs in file"; }
virtual void inspect(
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs