-
Notifications
You must be signed in to change notification settings - Fork 495
XTypes Branch: lint.pl: Additional Checks and Improvements #2161
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
Conversation
- Added `whitespace_before_newline_in_string` and `missing_include_guard` checks. - Added `--fix` to try to fix issues. So far this only works for the checks with `strip_fix` property set and the `missing_include_guard` check if there's an existing include guard. - Way to pass arguments to ACE `fuzz.pl`. - Add more info to `--help` message. - ANSI Escape Code Colors in messages - For checks using `line_matched` that support it, highlight what the offending characters of the line are in a separate error message.
Tabs usually are being used for indention, so have to be replace with appropriate amount of spaces instead of just being removed.
Rename `not_exactly_one_eof_newline` check to `eof_newline_count`. Made it accept a blank line at the end of text files. Also fixed an issue where it actually wasn't catching when there were no newlines at the end of the file. This means there must be 1 or two newline characters at the end of a file now.
Running this kind of generic cleanup on the xtypes branch could result in more merge conflicts on master, wouldn't it be better to run this on master and merge that in xtypes to prevent merge conflicts? |
I did consider that, but like in #2114, I'm trying to avoid putting these kinds of changes in master since we're trying to do a release. Plus doing it here means I can make sure the xtypes branch is compliant, instead of waiting until mater is merged in. |
Also: - Ability to run checks on something that's not OpenDDS - Proper error message if invalid check is passed - Control color output with --[no-]color and NO_COLOR, Default is now based on isatty.
I don't know what's going on in GCC6 yet, but the Java support has revealed an issue in The way I see it there are at least three options:
|
Fixes an issue that came up in OpenDDS/OpenDDS#2161. To make behavior of `#include ".."` consistent with C and C++, change how `tao_idl` calls the C preprocessor by default in most cases from making a copy of the IDL file to using the IDL file directly.
The Java issue is fixed with ACE/TAO #1357. |
This is a backport of the same commit in DOCGroup#1357, but with copy preprocessor input method being the default. Fixes an issue that came up in OpenDDS/OpenDDS#2161. To make behavior of `#include ".."` consistent with C and C++, change how `tao_idl` calls the C preprocessor by default in most cases from making a copy of the IDL file to using the IDL file directly.
Added the following checks and changed OpenDDS to pass these checks:
whitespace_before_newline_in_string
: ex:"This is a string \n"
missing_include_guard
: Checks IDL and header files for include guards matching one of two patterns. Both start with the file path, takedds/
off the front, turn anything that's not alphanumeric or an underscore to underscores, uppercase everything and prependOPENDDS_
. The difference between them is one converts from camel case to snake case while the other doesn't. For example,dds/DdsDcps.idl
can beOPENDDS_DDSDCPS_IDL
orOPENDDS_DDS_DCPS_IDL
.nonrelative_include_path
: Checks to see if an include statement path contains the including file's directory in it. For example iffoo/bar.h
has#include <foo/util/stuff.h>
, it should be#include "util/stuff.h"
.Added
--try-fix
to try to fix issues. So far this only works for the checks withstrip_fix
property set and themissing_include_guard
check if there's an existing include guard.Way to pass arguments to ACE
fuzz.pl
.Add more info to
--help
message.🌈 ANSI Escape Code Colors in messages 🌈 Can be controlled using command line arguments and environment variables.
For checks using
line_matched
that support it, highlight what the offending characters of the line are in a separate error message.Rename
not_exactly_one_eof_newline
check toeof_newline_count
. Made it accept a blank line at the end of text files. Also fixed an issue where it actually wasn't catching when there were no newlines at the end of the file. This means there must be 1 or 2 newline characters at the end of a file now.Checks are now listed and happen in consistent order now (alphabetically) and a proper error message is displayed when an invalid check is passed as an argument.
Ability to check paths outside of OpenDDS, assuming the check isn't OpenDDS specific.