adlint 2.6.14 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +1 -3
- data/ChangeLog +511 -0
- data/INSTALL +1 -1
- data/MANIFEST +57 -37
- data/NEWS +36 -7
- data/README +2 -2
- data/Rakefile +6 -6
- data/TODO +1 -1
- data/bin/adlint +25 -16
- data/bin/adlint_chk +22 -12
- data/bin/adlint_cma +17 -12
- data/bin/adlint_sma +22 -12
- data/bin/adlintize +98 -17
- data/etc/conf.d/fallback/cinit.erb +1 -1
- data/etc/conf.d/fallback/traits.erb +37 -37
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +1 -1
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +41 -41
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +1 -1
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +40 -40
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +1 -1
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +40 -40
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +40 -40
- data/etc/conf.d/noarch/GNUmakefile.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_bat.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_sh.erb +1 -1
- data/etc/conf.d/noarch/pinit.erb +1 -1
- data/etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb +1 -1
- data/etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb +42 -42
- data/etc/mesg.d/c_builtin/en_US/messages.yml +33 -33
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +5 -5
- data/etc/mesg.d/core/en_US/messages.yml +2 -2
- data/etc/mesg.d/core/ja_JP/messages.yml +2 -2
- data/features/code_check/W0018.feature +197 -0
- data/features/code_check/W0019.feature +79 -0
- data/features/code_check/W0021.feature +81 -0
- data/features/code_check/W0023.feature +203 -0
- data/features/code_check/W0024.feature +226 -0
- data/features/code_check/W0025.feature +5 -0
- data/features/code_check/W0088.feature +2 -2
- data/features/code_check/W0109.feature +2 -2
- data/features/code_check/W0477.feature +0 -3
- data/features/code_check/W0478.feature +0 -1
- data/features/code_check/W0582.feature +3 -3
- data/features/code_check/W0583.feature +4 -7
- data/features/code_check/W0646.feature +0 -1
- data/features/code_check/W0695.feature +0 -1
- data/features/code_check/W0705.feature +8 -0
- data/features/code_check/W0723.feature +0 -1
- data/features/code_check/W0745.feature +1 -0
- data/features/code_check/W0781.feature +1 -0
- data/features/code_check/W1057.feature +141 -0
- data/features/code_check/W1058.feature +93 -0
- data/features/code_check/W1059.feature +86 -0
- data/features/code_check/W1060.feature +77 -0
- data/features/code_check/W1061.feature +143 -0
- data/features/code_check/W1062.feature +162 -0
- data/features/code_check/W1063.feature +123 -0
- data/features/code_check/W1064.feature +83 -0
- data/features/code_check/W1065.feature +82 -0
- data/features/code_check/W9003.feature +2 -0
- data/features/step_definitions/code_check_steps.rb +1 -0
- data/features/support/env.rb +16 -13
- data/lib/adlint.rb +7 -4
- data/lib/adlint/analyzer.rb +131 -157
- data/lib/adlint/annot.rb +149 -0
- data/lib/adlint/cc1.rb +57 -0
- data/lib/adlint/{c → cc1}/branch.rb +74 -62
- data/lib/adlint/{c → cc1}/builtin.rb +21 -21
- data/lib/adlint/{c → cc1}/const.rb +119 -117
- data/lib/adlint/{c → cc1}/conv.rb +76 -78
- data/lib/adlint/{c → cc1}/ctrlexpr.rb +69 -86
- data/lib/adlint/cc1/domain.rb +8103 -0
- data/lib/adlint/{c → cc1}/enum.rb +3 -3
- data/lib/adlint/{c → cc1}/environ.rb +21 -21
- data/lib/adlint/{c → cc1}/expr.rb +232 -218
- data/lib/adlint/{c → cc1}/format.rb +305 -342
- data/lib/adlint/{c → cc1}/interp.rb +269 -220
- data/lib/adlint/cc1/lexer.rb +246 -0
- data/lib/adlint/{c → cc1}/mediator.rb +78 -84
- data/lib/adlint/{c → cc1}/object.rb +261 -264
- data/lib/adlint/{c → cc1}/operator.rb +7 -7
- data/lib/adlint/{c → cc1}/option.rb +4 -3
- data/lib/adlint/{c → cc1}/parser.rb +274 -506
- data/lib/adlint/{c → cc1}/parser.y +69 -301
- data/lib/adlint/cc1/phase.rb +138 -0
- data/lib/adlint/{c → cc1}/resolver.rb +66 -78
- data/lib/adlint/{c → cc1}/scanner.rb +57 -49
- data/lib/adlint/{c → cc1}/scope.rb +3 -3
- data/lib/adlint/{c → cc1}/seqp.rb +13 -5
- data/lib/adlint/{c → cc1}/syntax.rb +819 -1122
- data/lib/adlint/{c → cc1}/type.rb +1498 -1479
- data/lib/adlint/{c → cc1}/util.rb +20 -12
- data/lib/adlint/{c → cc1}/value.rb +699 -642
- data/lib/adlint/code.rb +163 -164
- data/lib/adlint/cpp.rb +2 -2
- data/lib/adlint/cpp/asm.rb +13 -14
- data/lib/adlint/cpp/constexpr.rb +42 -38
- data/lib/adlint/cpp/constexpr.y +44 -40
- data/lib/adlint/cpp/eval.rb +435 -435
- data/lib/adlint/cpp/lexer.rb +343 -340
- data/lib/adlint/cpp/macro.rb +188 -190
- data/lib/adlint/cpp/phase.rb +66 -45
- data/lib/adlint/cpp/scanner.rb +14 -17
- data/lib/adlint/cpp/source.rb +49 -55
- data/lib/adlint/cpp/subst.rb +65 -65
- data/lib/adlint/cpp/syntax.rb +155 -275
- data/lib/adlint/cpp/util.rb +22 -19
- data/lib/adlint/driver.rb +86 -93
- data/lib/adlint/error.rb +33 -52
- data/lib/adlint/exam.rb +158 -24
- data/lib/adlint/exam/c_builtin.rb +7 -7
- data/lib/adlint/exam/c_builtin/cc1_check.rb +20522 -0
- data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +957 -0
- data/lib/adlint/exam/c_builtin/cc1_code.rb +459 -0
- data/lib/adlint/exam/c_builtin/cc1_metric.rb +794 -0
- data/lib/adlint/exam/c_builtin/cpp_check.rb +486 -441
- data/lib/adlint/exam/c_builtin/cpp_check_shima.rb +36 -39
- data/lib/adlint/exam/c_builtin/cpp_code.rb +63 -65
- data/lib/adlint/exam/c_builtin/ld_check.rb +136 -129
- data/lib/adlint/exam/c_builtin/ld_metric.rb +11 -11
- data/lib/adlint/lang.rb +25 -25
- data/lib/adlint/ld.rb +2 -2
- data/lib/adlint/ld/object.rb +220 -188
- data/lib/adlint/ld/phase.rb +94 -63
- data/lib/adlint/ld/typedef.rb +22 -11
- data/lib/adlint/ld/util.rb +43 -35
- data/lib/adlint/lexer.rb +59 -56
- data/lib/adlint/location.rb +140 -0
- data/lib/adlint/memo.rb +157 -0
- data/lib/adlint/message.rb +207 -156
- data/lib/adlint/metric.rb +139 -217
- data/lib/adlint/monitor.rb +45 -43
- data/lib/adlint/phase.rb +56 -29
- data/lib/adlint/prelude.rb +66 -54
- data/lib/adlint/report.rb +253 -332
- data/lib/adlint/source.rb +26 -27
- data/lib/adlint/supp.rb +131 -0
- data/lib/adlint/symbol.rb +14 -16
- data/lib/adlint/token.rb +19 -91
- data/lib/adlint/traits.rb +242 -226
- data/lib/adlint/util.rb +116 -205
- data/lib/adlint/version.rb +8 -8
- data/share/HEADER +2 -2
- data/share/doc/developers_guide_ja.html +148 -19
- data/share/doc/developers_guide_ja.texi +141 -11
- data/share/doc/samples/GNUmakefile +1 -1
- data/share/doc/samples/adlint_traits.yml +45 -36
- data/share/doc/users_guide_en.html +1321 -1252
- data/share/doc/users_guide_en.texi +475 -408
- data/share/doc/users_guide_ja.html +1932 -1878
- data/share/doc/users_guide_ja.texi +324 -273
- data/share/sample/bison-2.5/adlint/GNUmakefile +5 -1
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +38 -38
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +50 -42
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +50 -42
- data/share/sample/ctags-5.8/adlint/GNUmakefile +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +50 -42
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +46 -38
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +50 -42
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +50 -42
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +50 -42
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +49 -41
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +46 -38
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +50 -42
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +50 -42
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +50 -42
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +50 -42
- data/spec/adlint/{c → cc1}/ctrlexpr_spec.rb +51 -49
- data/spec/adlint/{c → cc1}/domain_spec.rb +210 -179
- data/spec/adlint/{c → cc1}/operator_spec.rb +3 -3
- data/spec/adlint/{c → cc1}/syntax_spec.rb +10 -12
- data/spec/adlint/{c → cc1}/type_spec.rb +61 -68
- data/{lib/adlint/c.rb → spec/adlint/location_spec.rb} +24 -29
- data/spec/conf.d/default_traits.yml +38 -37
- data/spec/conf.d/empty_cinit.h +1 -1
- data/spec/conf.d/empty_pinit.h +1 -1
- data/spec/conf.d/project/foo.c +0 -0
- data/spec/spec_helper.rb +2 -2
- metadata +60 -40
- data/lib/adlint/c/domain.rb +0 -7931
- data/lib/adlint/c/lexer.rb +0 -252
- data/lib/adlint/c/phase.rb +0 -135
- data/lib/adlint/exam/c_builtin/c_check.rb +0 -20745
- data/lib/adlint/exam/c_builtin/c_check_shima.rb +0 -983
- data/lib/adlint/exam/c_builtin/c_code.rb +0 -477
- data/lib/adlint/exam/c_builtin/c_metric.rb +0 -818
data/lib/adlint/traits.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AdLint analysis project configuration.
|
|
2
2
|
#
|
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
|
4
|
+
# Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
|
6
6
|
#
|
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
15
15
|
#
|
|
16
16
|
# This file is part of AdLint.
|
|
17
17
|
#
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
#++
|
|
31
31
|
|
|
32
32
|
require "adlint/version"
|
|
33
|
-
require "adlint/exam"
|
|
34
33
|
require "adlint/util"
|
|
35
34
|
|
|
36
35
|
module AdLint #:nodoc:
|
|
@@ -38,30 +37,31 @@ module AdLint #:nodoc:
|
|
|
38
37
|
# == DESCRIPTION
|
|
39
38
|
# Analysis configuration information.
|
|
40
39
|
class Traits
|
|
41
|
-
include Singleton
|
|
42
40
|
include Validation
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
def initialize(traits_fpath)
|
|
43
|
+
File.open(traits_fpath, "r:utf-8") do |io|
|
|
44
|
+
case ary_or_stream = YAML.load_stream(io)
|
|
45
|
+
when Array
|
|
46
|
+
# NOTE: YAML.load_stream returns Array in Ruby 1.9.3-preview1.
|
|
47
|
+
doc = ary_or_stream.first
|
|
48
|
+
when YAML::Stream
|
|
49
|
+
doc = ary_or_stream.documents.first
|
|
50
|
+
end
|
|
51
|
+
validate_version(doc["version"])
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
@exam_packages = (doc["exam_packages"] || []).uniq.map { |name|
|
|
54
|
+
ExaminationPackage.new(name)
|
|
55
|
+
}.freeze
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
@project_traits = ProjectTraits.new(doc["project_traits"]).freeze
|
|
58
|
+
@compiler_traits = CompilerTraits.new(doc["compiler_traits"]).freeze
|
|
59
|
+
@linker_traits = LinkerTraits.new(doc["linker_traits"]).freeze
|
|
60
|
+
@message_traits = MessageTraits.new(doc["message_traits"]).freeze
|
|
61
|
+
end
|
|
58
62
|
end
|
|
59
63
|
|
|
60
|
-
|
|
61
|
-
ensure_validity_of :project_traits
|
|
62
|
-
ensure_validity_of :compiler_traits
|
|
63
|
-
ensure_validity_of :linker_traits
|
|
64
|
-
ensure_validity_of :message_traits
|
|
64
|
+
attr_reader :exam_packages
|
|
65
65
|
|
|
66
66
|
def of_project
|
|
67
67
|
@project_traits
|
|
@@ -79,32 +79,20 @@ module AdLint #:nodoc:
|
|
|
79
79
|
@message_traits
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
def
|
|
83
|
-
|
|
84
|
-
case array_or_stream = YAML.load_stream(io)
|
|
85
|
-
when Array
|
|
86
|
-
# NOTE: YAML.load_stream returns Array in Ruby 1.9.3-preview1.
|
|
87
|
-
doc = array_or_stream.first
|
|
88
|
-
when YAML::Stream
|
|
89
|
-
doc = array_or_stream.documents.first
|
|
90
|
-
end
|
|
91
|
-
validate_version(doc["version"])
|
|
92
|
-
|
|
93
|
-
@exam_packages = (doc["exam_packages"] || []).uniq.map { |name|
|
|
94
|
-
ExaminationPackage.new(name)
|
|
95
|
-
}.freeze
|
|
96
|
-
|
|
97
|
-
@project_traits = ProjectTraits.new(doc["project_traits"]).freeze
|
|
98
|
-
@compiler_traits = CompilerTraits.new(doc["compiler_traits"]).freeze
|
|
99
|
-
@linker_traits = LinkerTraits.new(doc["linker_traits"]).freeze
|
|
100
|
-
@message_traits = MessageTraits.new(doc["message_traits"]).freeze
|
|
101
|
-
end
|
|
82
|
+
def entity_name
|
|
83
|
+
""
|
|
102
84
|
end
|
|
103
85
|
|
|
86
|
+
ensure_exam_packages_presence_of :exam_packages
|
|
87
|
+
ensure_validity_of :project_traits
|
|
88
|
+
ensure_validity_of :compiler_traits
|
|
89
|
+
ensure_validity_of :linker_traits
|
|
90
|
+
ensure_validity_of :message_traits
|
|
91
|
+
|
|
104
92
|
private
|
|
105
|
-
def validate_version(
|
|
106
|
-
|
|
107
|
-
raise "invalid version of the
|
|
93
|
+
def validate_version(ver)
|
|
94
|
+
ver == TRAITS_SCHEMA_VERSION or
|
|
95
|
+
raise "invalid version of the traits file.\n" +
|
|
108
96
|
"regenerate or migrate traits file by new `adlintize' command."
|
|
109
97
|
end
|
|
110
98
|
end
|
|
@@ -114,15 +102,16 @@ module AdLint #:nodoc:
|
|
|
114
102
|
include CompoundPathParser
|
|
115
103
|
|
|
116
104
|
def initialize(doc)
|
|
117
|
-
@project_name
|
|
118
|
-
@project_root
|
|
119
|
-
@
|
|
120
|
-
@initial_header
|
|
121
|
-
@
|
|
122
|
-
@
|
|
105
|
+
@project_name = doc["project_name"]
|
|
106
|
+
@project_root = Pathname.new(doc["project_root"])
|
|
107
|
+
@target_files = TargetFiles.new(doc["target_files"])
|
|
108
|
+
@initial_header = doc["initial_header"]
|
|
109
|
+
@file_search_paths = parse_compound_path_list(doc["file_search_paths"])
|
|
110
|
+
@coding_style = CodingStyle.new(doc["coding_style"])
|
|
111
|
+
@file_encoding = doc["file_encoding"]
|
|
123
112
|
end
|
|
124
113
|
|
|
125
|
-
def
|
|
114
|
+
def entity_name
|
|
126
115
|
"project_traits"
|
|
127
116
|
end
|
|
128
117
|
|
|
@@ -132,12 +121,15 @@ module AdLint #:nodoc:
|
|
|
132
121
|
attr_reader :project_root
|
|
133
122
|
ensure_dir_presence_of :project_root
|
|
134
123
|
|
|
135
|
-
attr_reader :
|
|
136
|
-
|
|
124
|
+
attr_reader :target_files
|
|
125
|
+
ensure_validity_of :target_files
|
|
137
126
|
|
|
138
127
|
attr_reader :initial_header
|
|
139
128
|
ensure_file_presence_of :initial_header, :allow_nil => true
|
|
140
129
|
|
|
130
|
+
attr_reader :file_search_paths
|
|
131
|
+
ensure_dirs_presence_of :file_search_paths
|
|
132
|
+
|
|
141
133
|
attr_reader :coding_style
|
|
142
134
|
ensure_validity_of :coding_style
|
|
143
135
|
|
|
@@ -145,20 +137,46 @@ module AdLint #:nodoc:
|
|
|
145
137
|
ensure_with :file_encoding, :message => "is not a valid encoding name.",
|
|
146
138
|
:validator => Encoding.method(:include_name?)
|
|
147
139
|
|
|
140
|
+
class TargetFiles
|
|
141
|
+
include Validation
|
|
142
|
+
include CompoundPathParser
|
|
143
|
+
|
|
144
|
+
def initialize(doc)
|
|
145
|
+
@inclusion_paths = parse_compound_path_list(doc["inclusion_paths"])
|
|
146
|
+
@exclusion_paths = parse_compound_path_list(doc["exclusion_paths"])
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def entity_name
|
|
150
|
+
"project_traits:target_files"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
attr_reader :inclusion_paths
|
|
154
|
+
ensure_dirs_presence_of :inclusion_paths
|
|
155
|
+
|
|
156
|
+
attr_reader :exclusion_paths
|
|
157
|
+
ensure_dirs_presence_of :exclusion_paths
|
|
158
|
+
|
|
159
|
+
def freeze
|
|
160
|
+
@inclusion_paths.freeze
|
|
161
|
+
@exclusion_paths.freeze
|
|
162
|
+
super
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
148
166
|
class CodingStyle
|
|
149
167
|
include Validation
|
|
150
168
|
|
|
151
|
-
K_AND_R = "K&R"
|
|
152
|
-
ALLMAN
|
|
153
|
-
GNU
|
|
169
|
+
K_AND_R = "K&R"
|
|
170
|
+
ALLMAN = "Allman"
|
|
171
|
+
GNU = "GNU"
|
|
154
172
|
|
|
155
173
|
def initialize(doc)
|
|
156
174
|
@indent_style = doc["indent_style"]
|
|
157
|
-
@tab_width
|
|
175
|
+
@tab_width = doc["tab_width"]
|
|
158
176
|
@indent_width = doc["indent_width"]
|
|
159
177
|
end
|
|
160
178
|
|
|
161
|
-
def
|
|
179
|
+
def entity_name
|
|
162
180
|
"project_traits:coding_style"
|
|
163
181
|
end
|
|
164
182
|
|
|
@@ -181,8 +199,8 @@ module AdLint #:nodoc:
|
|
|
181
199
|
|
|
182
200
|
def freeze
|
|
183
201
|
@project_name.freeze
|
|
184
|
-
@
|
|
185
|
-
@
|
|
202
|
+
@target_files.freeze
|
|
203
|
+
@file_search_paths.freeze
|
|
186
204
|
@coding_style.freeze
|
|
187
205
|
@file_encoding.freeze
|
|
188
206
|
super
|
|
@@ -196,33 +214,34 @@ module AdLint #:nodoc:
|
|
|
196
214
|
include CompoundPathParser
|
|
197
215
|
|
|
198
216
|
def initialize(doc)
|
|
199
|
-
@
|
|
200
|
-
@
|
|
201
|
-
@
|
|
202
|
-
@arithmetic
|
|
203
|
-
@
|
|
204
|
-
|
|
205
|
-
@
|
|
217
|
+
@initial_header = doc["initial_header"]
|
|
218
|
+
@file_search_paths = parse_compound_path_list(doc["file_search_paths"])
|
|
219
|
+
@standard_types = StandardTypes.new(doc["standard_types"])
|
|
220
|
+
@arithmetic = Arithmetic.new(doc["arithmetic"])
|
|
221
|
+
@identifier_max = doc["identifier_max"]
|
|
222
|
+
|
|
223
|
+
@extension_substitutions = doc["extension_substitutions"] || {}
|
|
224
|
+
@arbitrary_substitutions = doc["arbitrary_substitutions"] || {}
|
|
206
225
|
end
|
|
207
226
|
|
|
208
|
-
def
|
|
227
|
+
def entity_name
|
|
209
228
|
"compiler_traits"
|
|
210
229
|
end
|
|
211
230
|
|
|
212
231
|
# === VALUE
|
|
213
|
-
#
|
|
214
|
-
attr_reader :
|
|
215
|
-
|
|
232
|
+
# String -- The file path of the initial source.
|
|
233
|
+
attr_reader :initial_header
|
|
234
|
+
ensure_file_presence_of :initial_header, :allow_nil => true
|
|
216
235
|
|
|
217
236
|
# === VALUE
|
|
218
237
|
# Array< String > -- System include paths.
|
|
219
|
-
attr_reader :
|
|
220
|
-
ensure_dirs_presence_of :
|
|
238
|
+
attr_reader :file_search_paths
|
|
239
|
+
ensure_dirs_presence_of :file_search_paths
|
|
221
240
|
|
|
222
241
|
# === VALUE
|
|
223
|
-
#
|
|
224
|
-
attr_reader :
|
|
225
|
-
|
|
242
|
+
# CompilerTraits::StandardTypes -- The standard type traits information.
|
|
243
|
+
attr_reader :standard_types
|
|
244
|
+
ensure_validity_of :standard_types
|
|
226
245
|
|
|
227
246
|
# === VALUE
|
|
228
247
|
# CompilerTraits::Arithmetic -- The arithmetic traits information.
|
|
@@ -230,60 +249,52 @@ module AdLint #:nodoc:
|
|
|
230
249
|
ensure_validity_of :arithmetic
|
|
231
250
|
|
|
232
251
|
# === VALUE
|
|
233
|
-
#
|
|
234
|
-
|
|
235
|
-
|
|
252
|
+
# Integer -- Max length of all symbols identified by the compiler.
|
|
253
|
+
attr_reader :identifier_max
|
|
254
|
+
ensure_numericality_of :identifier_max, :only_integer => true, :min => 1
|
|
236
255
|
|
|
237
256
|
# === VALUE
|
|
238
|
-
# Hash<String, String > -- The
|
|
239
|
-
|
|
257
|
+
# Hash<String, String > -- The compiler-extension code substitution
|
|
258
|
+
# settings.
|
|
259
|
+
attr_reader :extension_substitutions
|
|
240
260
|
|
|
241
261
|
# === VALUE
|
|
242
|
-
#
|
|
243
|
-
attr_reader :
|
|
244
|
-
ensure_numericality_of :identifier_max, :only_integer => true, :min => 1
|
|
262
|
+
# Hash<String, String > -- The arbitrary code substitution settings.
|
|
263
|
+
attr_reader :arbitrary_substitutions
|
|
245
264
|
|
|
246
265
|
# == DESCRIPTION
|
|
247
266
|
# Traits information of standard types.
|
|
248
|
-
class
|
|
267
|
+
class StandardTypes
|
|
249
268
|
include Validation
|
|
250
269
|
|
|
251
270
|
def initialize(doc)
|
|
252
|
-
@char_size
|
|
253
|
-
@char_alignment
|
|
254
|
-
|
|
255
|
-
@
|
|
256
|
-
@
|
|
257
|
-
|
|
258
|
-
@
|
|
259
|
-
@
|
|
260
|
-
|
|
261
|
-
@
|
|
262
|
-
@
|
|
263
|
-
|
|
264
|
-
@
|
|
265
|
-
@
|
|
266
|
-
|
|
267
|
-
@float_size = doc["float_size"]
|
|
268
|
-
@float_alignment = doc["float_alignment"]
|
|
269
|
-
|
|
270
|
-
@double_size = doc["double_size"]
|
|
271
|
-
@double_alignment = doc["double_alignment"]
|
|
272
|
-
|
|
273
|
-
@long_double_size = doc["long_double_size"]
|
|
271
|
+
@char_size = doc["char_size"]
|
|
272
|
+
@char_alignment = doc["char_alignment"]
|
|
273
|
+
@short_size = doc["short_size"]
|
|
274
|
+
@short_alignment = doc["short_alignment"]
|
|
275
|
+
@int_size = doc["int_size"]
|
|
276
|
+
@int_alignment = doc["int_alignment"]
|
|
277
|
+
@long_size = doc["long_size"]
|
|
278
|
+
@long_alignment = doc["long_alignment"]
|
|
279
|
+
@long_long_size = doc["long_long_size"]
|
|
280
|
+
@long_long_alignment = doc["long_long_alignment"]
|
|
281
|
+
@float_size = doc["float_size"]
|
|
282
|
+
@float_alignment = doc["float_alignment"]
|
|
283
|
+
@double_size = doc["double_size"]
|
|
284
|
+
@double_alignment = doc["double_alignment"]
|
|
285
|
+
@long_double_size = doc["long_double_size"]
|
|
274
286
|
@long_double_alignment = doc["long_double_alignment"]
|
|
275
287
|
|
|
276
|
-
@code_ptr_size
|
|
277
|
-
@code_ptr_alignment
|
|
278
|
-
|
|
279
|
-
@
|
|
280
|
-
@data_ptr_alignment = doc["data_ptr_alignment"]
|
|
288
|
+
@code_ptr_size = doc["code_ptr_size"]
|
|
289
|
+
@code_ptr_alignment = doc["code_ptr_alignment"]
|
|
290
|
+
@data_ptr_size = doc["data_ptr_size"]
|
|
291
|
+
@data_ptr_alignment = doc["data_ptr_alignment"]
|
|
281
292
|
|
|
282
293
|
@char_as_unsigned_char = doc["char_as_unsigned_char"]
|
|
283
294
|
end
|
|
284
295
|
|
|
285
|
-
def
|
|
286
|
-
"compiler_traits:
|
|
296
|
+
def entity_name
|
|
297
|
+
"compiler_traits:standard_types"
|
|
287
298
|
end
|
|
288
299
|
|
|
289
300
|
# === VALUE
|
|
@@ -407,7 +418,7 @@ module AdLint #:nodoc:
|
|
|
407
418
|
super
|
|
408
419
|
end
|
|
409
420
|
end
|
|
410
|
-
private_constant :
|
|
421
|
+
private_constant :StandardTypes
|
|
411
422
|
|
|
412
423
|
# == DESCRIPTION
|
|
413
424
|
# Traits information of arithmetic process.
|
|
@@ -418,7 +429,7 @@ module AdLint #:nodoc:
|
|
|
418
429
|
@logical_right_shift = doc["logical_right_shift"]
|
|
419
430
|
end
|
|
420
431
|
|
|
421
|
-
def
|
|
432
|
+
def entity_name
|
|
422
433
|
"compiler_traits:arithmetic"
|
|
423
434
|
end
|
|
424
435
|
|
|
@@ -436,13 +447,12 @@ module AdLint #:nodoc:
|
|
|
436
447
|
private_constant :Arithmetic
|
|
437
448
|
|
|
438
449
|
def freeze
|
|
439
|
-
@
|
|
440
|
-
@
|
|
441
|
-
@initial_header.freeze
|
|
450
|
+
@file_search_paths.freeze
|
|
451
|
+
@standard_types.freeze
|
|
442
452
|
@arithmetic.freeze
|
|
443
|
-
@extension_substitution.freeze
|
|
444
|
-
@arbitrary_substitution.freeze
|
|
445
453
|
@identifier_max.freeze
|
|
454
|
+
@extension_substitutions.freeze
|
|
455
|
+
@arbitrary_substitutions.freeze
|
|
446
456
|
super
|
|
447
457
|
end
|
|
448
458
|
end
|
|
@@ -453,11 +463,11 @@ module AdLint #:nodoc:
|
|
|
453
463
|
include Validation
|
|
454
464
|
|
|
455
465
|
def initialize(doc)
|
|
456
|
-
@identifier_max
|
|
466
|
+
@identifier_max = doc["identifier_max"]
|
|
457
467
|
@identifier_ignore_case = doc["identifier_ignore_case"]
|
|
458
468
|
end
|
|
459
469
|
|
|
460
|
-
def
|
|
470
|
+
def entity_name
|
|
461
471
|
"linker_traits"
|
|
462
472
|
end
|
|
463
473
|
|
|
@@ -484,37 +494,26 @@ module AdLint #:nodoc:
|
|
|
484
494
|
include CompoundPathParser
|
|
485
495
|
|
|
486
496
|
def initialize(doc)
|
|
487
|
-
@language
|
|
488
|
-
@
|
|
489
|
-
@
|
|
490
|
-
@
|
|
491
|
-
|
|
492
|
-
@exclusion = Exclusion.new(doc["exclusion"])
|
|
493
|
-
@inclusion = Inclusion.new(doc["inclusion"])
|
|
497
|
+
@language = doc["language"]
|
|
498
|
+
@individual_suppression = doc["individual_suppression"]
|
|
499
|
+
@exclusion = Exclusion.new(doc["exclusion"])
|
|
500
|
+
@inclusion = Inclusion.new(doc["inclusion"])
|
|
501
|
+
|
|
494
502
|
@change_list =
|
|
495
|
-
(doc["change_list"] || []).each_with_object({}) { |(
|
|
496
|
-
hash[[
|
|
503
|
+
(doc["change_list"] || []).each_with_object({}) { |(name, cont), hash|
|
|
504
|
+
hash[MessageId.new(cont["package"], name.to_sym)] = cont
|
|
497
505
|
}
|
|
498
506
|
end
|
|
499
507
|
|
|
500
|
-
def
|
|
508
|
+
def entity_name
|
|
501
509
|
"message_traits"
|
|
502
510
|
end
|
|
503
511
|
|
|
504
512
|
attr_reader :language
|
|
505
513
|
ensure_inclusion_of :language, :values => %w(ja_JP en_US)
|
|
506
514
|
|
|
507
|
-
attr_reader :
|
|
508
|
-
ensure_true_or_false_of :
|
|
509
|
-
|
|
510
|
-
attr_reader :warn_files_in
|
|
511
|
-
ensure_dirs_presence_of :warn_files_in
|
|
512
|
-
|
|
513
|
-
attr_reader :warn_files_not_in
|
|
514
|
-
ensure_dirs_presence_of :warn_files_not_in
|
|
515
|
-
|
|
516
|
-
attr_reader :individual_selection
|
|
517
|
-
ensure_true_or_false_of :individual_selection
|
|
515
|
+
attr_reader :individual_suppression
|
|
516
|
+
ensure_true_or_false_of :individual_suppression
|
|
518
517
|
|
|
519
518
|
attr_reader :exclusion
|
|
520
519
|
ensure_validity_of :exclusion
|
|
@@ -530,26 +529,25 @@ module AdLint #:nodoc:
|
|
|
530
529
|
def initialize(doc)
|
|
531
530
|
if doc
|
|
532
531
|
@categories = doc["categories"] || []
|
|
533
|
-
@severities = Regexp.new(doc["severities"])
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
[package, id.intern]
|
|
532
|
+
@severities = doc["severities"] ? Regexp.new(doc["severities"]) : nil
|
|
533
|
+
@messages = (doc["messages"] || {}).map { |msg_name, pkg_name|
|
|
534
|
+
MessageId.new(pkg_name, msg_name.to_sym)
|
|
537
535
|
}.to_set
|
|
538
536
|
else
|
|
539
537
|
@categories = []
|
|
540
|
-
@severities =
|
|
541
|
-
@messages
|
|
538
|
+
@severities = nil
|
|
539
|
+
@messages = Set.new
|
|
542
540
|
end
|
|
543
541
|
end
|
|
544
542
|
|
|
543
|
+
def entity_name
|
|
544
|
+
"message_traits:exclusion"
|
|
545
|
+
end
|
|
546
|
+
|
|
545
547
|
attr_reader :categories
|
|
546
548
|
attr_reader :severities
|
|
547
549
|
attr_reader :messages
|
|
548
550
|
|
|
549
|
-
def name
|
|
550
|
-
"message_traits:exclusion"
|
|
551
|
-
end
|
|
552
|
-
|
|
553
551
|
def freeze
|
|
554
552
|
@categories.freeze
|
|
555
553
|
@severities.freeze
|
|
@@ -564,21 +562,20 @@ module AdLint #:nodoc:
|
|
|
564
562
|
|
|
565
563
|
def initialize(doc)
|
|
566
564
|
if doc
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
[package, id.intern]
|
|
565
|
+
@messages = (doc["messages"] || {}).map { |msg_name, pkg_name|
|
|
566
|
+
MessageId.new(pkg_name, msg_name.to_sym)
|
|
570
567
|
}.to_set
|
|
571
568
|
else
|
|
572
569
|
@messages = Set.new
|
|
573
570
|
end
|
|
574
571
|
end
|
|
575
572
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
def name
|
|
573
|
+
def entity_name
|
|
579
574
|
"message_traits:inclusion"
|
|
580
575
|
end
|
|
581
576
|
|
|
577
|
+
attr_reader :messages
|
|
578
|
+
|
|
582
579
|
def freeze
|
|
583
580
|
@messages.freeze
|
|
584
581
|
super
|
|
@@ -588,10 +585,7 @@ module AdLint #:nodoc:
|
|
|
588
585
|
|
|
589
586
|
def freeze
|
|
590
587
|
@language.freeze
|
|
591
|
-
@
|
|
592
|
-
@warn_files_in.freeze
|
|
593
|
-
@warn_files_not_in.freeze
|
|
594
|
-
@individual_selection.freeze
|
|
588
|
+
@individual_suppression.freeze
|
|
595
589
|
@exclusion.freeze
|
|
596
590
|
@inclusion.freeze
|
|
597
591
|
@change_list.freeze
|
|
@@ -599,142 +593,164 @@ module AdLint #:nodoc:
|
|
|
599
593
|
end
|
|
600
594
|
end
|
|
601
595
|
|
|
602
|
-
module
|
|
603
|
-
|
|
604
|
-
|
|
596
|
+
module CodingStyleAccessor
|
|
597
|
+
# NOTE: Host class must respond to #traits.
|
|
598
|
+
|
|
599
|
+
def coding_style
|
|
600
|
+
traits.of_project.coding_style
|
|
601
|
+
end
|
|
602
|
+
|
|
603
|
+
def indent_style
|
|
604
|
+
coding_style.indent_style
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
def tab_width
|
|
608
|
+
coding_style.tab_width
|
|
609
|
+
end
|
|
610
|
+
|
|
611
|
+
def indent_width
|
|
612
|
+
coding_style.indent_width
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
INDENT_STYLE_K_AND_R = ProjectTraits::CodingStyle::K_AND_R
|
|
616
|
+
INDENT_STYLE_ALLMAN = ProjectTraits::CodingStyle::ALLMAN
|
|
617
|
+
INDENT_STYLE_GNU = ProjectTraits::CodingStyle::GNU
|
|
618
|
+
end
|
|
619
|
+
|
|
620
|
+
module StandardTypesAccessor
|
|
621
|
+
# NOTE: Host class must respond to #traits.
|
|
622
|
+
|
|
623
|
+
def standard_types
|
|
624
|
+
traits.of_compiler.standard_types
|
|
605
625
|
end
|
|
606
|
-
module_function :standard_type
|
|
607
626
|
|
|
608
627
|
def char_size
|
|
609
|
-
|
|
628
|
+
standard_types.char_size
|
|
610
629
|
end
|
|
611
|
-
module_function :char_size
|
|
612
630
|
|
|
613
631
|
def char_alignment
|
|
614
|
-
|
|
632
|
+
standard_types.char_alignment
|
|
615
633
|
end
|
|
616
|
-
module_function :char_alignment
|
|
617
634
|
|
|
618
635
|
def short_size
|
|
619
|
-
|
|
636
|
+
standard_types.short_size
|
|
620
637
|
end
|
|
621
|
-
module_function :short_size
|
|
622
638
|
|
|
623
639
|
def short_alignment
|
|
624
|
-
|
|
640
|
+
standard_types.short_alignment
|
|
625
641
|
end
|
|
626
|
-
module_function :short_alignment
|
|
627
642
|
|
|
628
643
|
def int_size
|
|
629
|
-
|
|
644
|
+
standard_types.int_size
|
|
630
645
|
end
|
|
631
|
-
module_function :int_size
|
|
632
646
|
|
|
633
647
|
def int_alignment
|
|
634
|
-
|
|
648
|
+
standard_types.int_alignment
|
|
635
649
|
end
|
|
636
|
-
module_function :int_alignment
|
|
637
650
|
|
|
638
651
|
def long_size
|
|
639
|
-
|
|
652
|
+
standard_types.long_size
|
|
640
653
|
end
|
|
641
|
-
module_function :long_size
|
|
642
654
|
|
|
643
655
|
def long_alignment
|
|
644
|
-
|
|
656
|
+
standard_types.long_alignment
|
|
645
657
|
end
|
|
646
|
-
module_function :long_alignment
|
|
647
658
|
|
|
648
659
|
def long_long_size
|
|
649
|
-
|
|
660
|
+
standard_types.long_long_size
|
|
650
661
|
end
|
|
651
|
-
module_function :long_long_size
|
|
652
662
|
|
|
653
663
|
def long_long_alignment
|
|
654
|
-
|
|
664
|
+
standard_types.long_long_alignment
|
|
655
665
|
end
|
|
656
|
-
module_function :long_long_alignment
|
|
657
666
|
|
|
658
667
|
def float_size
|
|
659
|
-
|
|
668
|
+
standard_types.float_size
|
|
660
669
|
end
|
|
661
|
-
module_function :float_size
|
|
662
670
|
|
|
663
671
|
def float_alignment
|
|
664
|
-
|
|
672
|
+
standard_types.float_alignment
|
|
665
673
|
end
|
|
666
|
-
module_function :float_alignment
|
|
667
674
|
|
|
668
675
|
def double_size
|
|
669
|
-
|
|
676
|
+
standard_types.double_size
|
|
670
677
|
end
|
|
671
|
-
module_function :double_size
|
|
672
678
|
|
|
673
679
|
def double_alignment
|
|
674
|
-
|
|
680
|
+
standard_types.double_alignment
|
|
675
681
|
end
|
|
676
|
-
module_function :double_alignment
|
|
677
682
|
|
|
678
683
|
def long_double_size
|
|
679
|
-
|
|
684
|
+
standard_types.long_double_size
|
|
680
685
|
end
|
|
681
|
-
module_function :long_double_size
|
|
682
686
|
|
|
683
687
|
def long_double_alignment
|
|
684
|
-
|
|
688
|
+
standard_types.long_double_alignment
|
|
685
689
|
end
|
|
686
|
-
module_function :long_double_alignment
|
|
687
690
|
|
|
688
691
|
def code_ptr_size
|
|
689
|
-
|
|
692
|
+
standard_types.code_ptr_size
|
|
690
693
|
end
|
|
691
|
-
module_function :code_ptr_size
|
|
692
694
|
|
|
693
695
|
def code_ptr_alignment
|
|
694
|
-
|
|
696
|
+
standard_types.code_ptr_alignment
|
|
695
697
|
end
|
|
696
|
-
module_function :code_ptr_alignment
|
|
697
698
|
|
|
698
699
|
def data_ptr_size
|
|
699
|
-
|
|
700
|
+
standard_types.data_ptr_size
|
|
700
701
|
end
|
|
701
|
-
module_function :data_ptr_size
|
|
702
702
|
|
|
703
703
|
def data_ptr_alignment
|
|
704
|
-
|
|
704
|
+
standard_types.data_ptr_alignment
|
|
705
705
|
end
|
|
706
|
-
module_function :data_ptr_alignment
|
|
707
706
|
|
|
708
707
|
def char_as_unsigned_char?
|
|
709
|
-
|
|
708
|
+
standard_types.char_as_unsigned_char
|
|
710
709
|
end
|
|
711
|
-
module_function :char_as_unsigned_char?
|
|
712
710
|
end
|
|
713
711
|
|
|
714
|
-
module
|
|
715
|
-
|
|
716
|
-
|
|
712
|
+
module ArithmeticAccessor
|
|
713
|
+
# NOTE: Host class must respond to #traits.
|
|
714
|
+
|
|
715
|
+
def arithmetic
|
|
716
|
+
traits.of_compiler.arithmetic
|
|
717
717
|
end
|
|
718
|
-
module_function :coding_style
|
|
719
718
|
|
|
720
|
-
def
|
|
721
|
-
|
|
719
|
+
def logical_right_shift?
|
|
720
|
+
arithmetic.logical_right_shift
|
|
722
721
|
end
|
|
723
|
-
|
|
722
|
+
end
|
|
724
723
|
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
module ExclusionAccessor
|
|
725
|
+
# NOTE: Host class must respond to #traits.
|
|
726
|
+
|
|
727
|
+
def exclusion
|
|
728
|
+
traits.of_message.exclusion
|
|
727
729
|
end
|
|
728
|
-
module_function :tab_width
|
|
729
730
|
|
|
730
|
-
def
|
|
731
|
-
|
|
731
|
+
def categories
|
|
732
|
+
exclusion.categories
|
|
732
733
|
end
|
|
733
|
-
module_function :indent_width
|
|
734
734
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
735
|
+
def severities
|
|
736
|
+
exclusion.severities
|
|
737
|
+
end
|
|
738
|
+
|
|
739
|
+
def messages
|
|
740
|
+
exclusion.messages
|
|
741
|
+
end
|
|
742
|
+
end
|
|
743
|
+
|
|
744
|
+
module InclusionAccessor
|
|
745
|
+
# NOTE: Host class must respond to #traits.
|
|
746
|
+
|
|
747
|
+
def inclusion
|
|
748
|
+
traits.of_message.inclusion
|
|
749
|
+
end
|
|
750
|
+
|
|
751
|
+
def messages
|
|
752
|
+
inclusion.messages
|
|
753
|
+
end
|
|
738
754
|
end
|
|
739
755
|
|
|
740
756
|
end
|