adlint 1.18.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (376) hide show
  1. data/ChangeLog +287 -188
  2. data/MANIFEST +278 -92
  3. data/NEWS +16 -4
  4. data/bin/adlintize +124 -3
  5. data/etc/conf.d/fallback/traits.erb +54 -1
  6. data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +54 -1
  7. data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +54 -1
  8. data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +54 -1
  9. data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +54 -1
  10. data/etc/mesg.d/c_builtin/en_US/messages.yml +2998 -0
  11. data/etc/mesg.d/c_builtin/ja_JP/messages.yml +2998 -0
  12. data/etc/mesg.d/core/en_US/messages.yml +134 -0
  13. data/etc/mesg.d/core/ja_JP/messages.yml +134 -0
  14. data/features/{message_detection → code_check}/E0013.feature +2 -2
  15. data/features/{message_detection → code_check}/W0001.feature +4 -4
  16. data/features/{message_detection → code_check}/W0002.feature +6 -6
  17. data/features/{message_detection → code_check}/W0003.feature +8 -8
  18. data/features/{message_detection → code_check}/W0007.feature +16 -16
  19. data/features/{message_detection → code_check}/W0010.feature +8 -8
  20. data/features/{message_detection → code_check}/W0013.feature +16 -16
  21. data/features/code_check/W0016.feature +200 -0
  22. data/features/code_check/W0017.feature +270 -0
  23. data/features/code_check/W0025.feature +66 -0
  24. data/features/code_check/W0026.feature +143 -0
  25. data/features/{message_detection → code_check}/W0093.feature +6 -6
  26. data/features/{message_detection → code_check}/W0104.feature +14 -14
  27. data/features/{message_detection → code_check}/W0109.feature +6 -6
  28. data/features/code_check/W0119.feature +151 -0
  29. data/features/code_check/W0120.feature +137 -0
  30. data/features/code_check/W0121.feature +147 -0
  31. data/features/code_check/W0122.feature +142 -0
  32. data/features/code_check/W0123.feature +147 -0
  33. data/features/code_check/W0124.feature +142 -0
  34. data/features/code_check/W0125.feature +147 -0
  35. data/features/code_check/W0126.feature +142 -0
  36. data/features/code_check/W0127.feature +147 -0
  37. data/features/code_check/W0128.feature +147 -0
  38. data/features/code_check/W0129.feature +147 -0
  39. data/features/code_check/W0130.feature +159 -0
  40. data/features/code_check/W0131.feature +154 -0
  41. data/features/code_check/W0132.feature +137 -0
  42. data/features/code_check/W0133.feature +151 -0
  43. data/features/code_check/W0134.feature +151 -0
  44. data/features/code_check/W0135.feature +147 -0
  45. data/features/code_check/W0136.feature +151 -0
  46. data/features/code_check/W0137.feature +147 -0
  47. data/features/code_check/W0138.feature +151 -0
  48. data/features/code_check/W0139.feature +147 -0
  49. data/features/code_check/W0140.feature +159 -0
  50. data/features/code_check/W0141.feature +155 -0
  51. data/features/code_check/W0142.feature +152 -0
  52. data/features/code_check/W0143.feature +147 -0
  53. data/features/code_check/W0144.feature +146 -0
  54. data/features/code_check/W0145.feature +147 -0
  55. data/features/code_check/W0146.feature +146 -0
  56. data/features/code_check/W0147.feature +146 -0
  57. data/features/code_check/W0148.feature +147 -0
  58. data/features/code_check/W0149.feature +146 -0
  59. data/features/code_check/W0150.feature +146 -0
  60. data/features/code_check/W0151.feature +146 -0
  61. data/features/code_check/W0152.feature +155 -0
  62. data/features/code_check/W0153.feature +155 -0
  63. data/features/code_check/W0154.feature +154 -0
  64. data/features/code_check/W0155.feature +154 -0
  65. data/features/code_check/W0156.feature +167 -0
  66. data/features/code_check/W0157.feature +152 -0
  67. data/features/code_check/W0158.feature +147 -0
  68. data/features/code_check/W0159.feature +147 -0
  69. data/features/code_check/W0160.feature +147 -0
  70. data/features/code_check/W0161.feature +151 -0
  71. data/features/code_check/W0162.feature +146 -0
  72. data/features/code_check/W0163.feature +146 -0
  73. data/features/code_check/W0164.feature +146 -0
  74. data/features/code_check/W0165.feature +151 -0
  75. data/features/code_check/W0166.feature +146 -0
  76. data/features/code_check/W0167.feature +146 -0
  77. data/features/code_check/W0168.feature +146 -0
  78. data/features/code_check/W0169.feature +151 -0
  79. data/features/code_check/W0170.feature +146 -0
  80. data/features/code_check/W0171.feature +146 -0
  81. data/features/code_check/W0172.feature +146 -0
  82. data/features/code_check/W0173.feature +159 -0
  83. data/features/code_check/W0174.feature +159 -0
  84. data/features/code_check/W0175.feature +158 -0
  85. data/features/code_check/W0176.feature +158 -0
  86. data/features/code_check/W0177.feature +159 -0
  87. data/features/code_check/W0178.feature +155 -0
  88. data/features/code_check/W0179.feature +154 -0
  89. data/features/code_check/W0180.feature +154 -0
  90. data/features/code_check/W0181.feature +167 -0
  91. data/features/code_check/W0182.feature +147 -0
  92. data/features/code_check/W0183.feature +147 -0
  93. data/features/code_check/W0184.feature +148 -0
  94. data/features/code_check/W0185.feature +142 -0
  95. data/features/code_check/W0186.feature +142 -0
  96. data/features/code_check/W0187.feature +142 -0
  97. data/features/code_check/W0188.feature +142 -0
  98. data/features/code_check/W0189.feature +142 -0
  99. data/features/code_check/W0190.feature +142 -0
  100. data/features/code_check/W0191.feature +142 -0
  101. data/features/code_check/W0192.feature +142 -0
  102. data/features/code_check/W0193.feature +143 -0
  103. data/features/code_check/W0194.feature +142 -0
  104. data/features/code_check/W0195.feature +142 -0
  105. data/features/code_check/W0196.feature +142 -0
  106. data/features/code_check/W0197.feature +142 -0
  107. data/features/code_check/W0198.feature +142 -0
  108. data/features/code_check/W0199.feature +143 -0
  109. data/features/code_check/W0200.feature +142 -0
  110. data/features/code_check/W0201.feature +142 -0
  111. data/features/code_check/W0202.feature +142 -0
  112. data/features/code_check/W0203.feature +142 -0
  113. data/features/code_check/W0204.feature +142 -0
  114. data/features/code_check/W0205.feature +143 -0
  115. data/features/code_check/W0206.feature +150 -0
  116. data/features/code_check/W0207.feature +150 -0
  117. data/features/code_check/W0208.feature +150 -0
  118. data/features/code_check/W0209.feature +151 -0
  119. data/features/code_check/W0210.feature +151 -0
  120. data/features/code_check/W0211.feature +151 -0
  121. data/features/code_check/W0212.feature +147 -0
  122. data/features/code_check/W0213.feature +142 -0
  123. data/features/code_check/W0214.feature +147 -0
  124. data/features/code_check/W0215.feature +142 -0
  125. data/features/code_check/W0216.feature +142 -0
  126. data/features/code_check/W0217.feature +142 -0
  127. data/features/code_check/W0218.feature +142 -0
  128. data/features/code_check/W0219.feature +142 -0
  129. data/features/code_check/W0220.feature +142 -0
  130. data/features/code_check/W0221.feature +147 -0
  131. data/features/code_check/W0222.feature +142 -0
  132. data/features/code_check/W0223.feature +147 -0
  133. data/features/code_check/W0224.feature +142 -0
  134. data/features/code_check/W0225.feature +142 -0
  135. data/features/code_check/W0226.feature +142 -0
  136. data/features/code_check/W0227.feature +142 -0
  137. data/features/code_check/W0228.feature +142 -0
  138. data/features/code_check/W0229.feature +142 -0
  139. data/features/code_check/W0230.feature +147 -0
  140. data/features/code_check/W0231.feature +142 -0
  141. data/features/code_check/W0232.feature +148 -0
  142. data/features/code_check/W0233.feature +142 -0
  143. data/features/code_check/W0234.feature +143 -0
  144. data/features/code_check/W0235.feature +142 -0
  145. data/features/code_check/W0236.feature +143 -0
  146. data/features/code_check/W0237.feature +142 -0
  147. data/features/code_check/W0238.feature +143 -0
  148. data/features/code_check/W0239.feature +154 -0
  149. data/features/code_check/W0240.feature +155 -0
  150. data/features/code_check/W0241.feature +154 -0
  151. data/features/code_check/W0242.feature +155 -0
  152. data/features/code_check/W0243.feature +154 -0
  153. data/features/code_check/W0244.feature +155 -0
  154. data/features/code_check/W0245.feature +147 -0
  155. data/features/code_check/W0246.feature +147 -0
  156. data/features/code_check/W0247.feature +147 -0
  157. data/features/code_check/W0248.feature +142 -0
  158. data/features/code_check/W0249.feature +142 -0
  159. data/features/code_check/W0250.feature +146 -0
  160. data/features/code_check/W0251.feature +159 -0
  161. data/features/code_check/W0252.feature +155 -0
  162. data/features/code_check/W0253.feature +154 -0
  163. data/features/code_check/W0254.feature +154 -0
  164. data/features/code_check/W0477.feature +77 -0
  165. data/features/code_check/W0478.feature +103 -0
  166. data/features/code_check/W0479.feature +65 -0
  167. data/features/code_check/W0480.feature +119 -0
  168. data/features/code_check/W0481.feature +28 -0
  169. data/features/code_check/W0482.feature +64 -0
  170. data/features/code_check/W0483.feature +62 -0
  171. data/features/code_check/W0573.feature +91 -0
  172. data/features/{message_detection → code_check}/W0583.feature +2 -2
  173. data/features/{message_detection → code_check}/W0606.feature +2 -2
  174. data/features/{message_detection → code_check}/W0641.feature +16 -16
  175. data/features/{message_detection → code_check}/W0643.feature +12 -12
  176. data/features/{message_detection → code_check}/W0644.feature +50 -50
  177. data/features/{message_detection → code_check}/W0645.feature +16 -16
  178. data/features/{message_detection → code_check}/W0646.feature +16 -16
  179. data/features/{message_detection → code_check}/W0649.feature +28 -28
  180. data/features/{message_detection → code_check}/W0650.feature +24 -24
  181. data/features/code_check/W0685.feature +120 -0
  182. data/features/code_check/W0686.feature +92 -0
  183. data/features/{message_detection → code_check}/W0687.feature +4 -4
  184. data/features/{message_detection → code_check}/W0688.feature +12 -12
  185. data/features/{message_detection → code_check}/W0689.feature +8 -8
  186. data/features/{message_detection → code_check}/W0690.feature +6 -6
  187. data/features/{message_detection → code_check}/W0691.feature +14 -14
  188. data/features/{message_detection → code_check}/W0692.feature +4 -4
  189. data/features/{message_detection → code_check}/W0694.feature +10 -10
  190. data/features/code_check/W0695.feature +78 -0
  191. data/features/{message_detection → code_check}/W0697.feature +18 -18
  192. data/features/{message_detection → code_check}/W0698.feature +2 -2
  193. data/features/{message_detection → code_check}/W0699.feature +2 -2
  194. data/features/{message_detection → code_check}/W0700.feature +6 -6
  195. data/features/{message_detection → code_check}/W0703.feature +6 -6
  196. data/features/{message_detection → code_check}/W0705.feature +24 -24
  197. data/features/{message_detection → code_check}/W0707.feature +20 -20
  198. data/features/{message_detection → code_check}/W0711.feature +10 -10
  199. data/features/{message_detection → code_check}/W0712.feature +10 -10
  200. data/features/{message_detection → code_check}/W0713.feature +10 -10
  201. data/features/{message_detection → code_check}/W0714.feature +10 -10
  202. data/features/{message_detection → code_check}/W0715.feature +11 -11
  203. data/features/{message_detection → code_check}/W0716.feature +6 -6
  204. data/features/{message_detection → code_check}/W0717.feature +6 -6
  205. data/features/{message_detection → code_check}/W0718.feature +6 -6
  206. data/features/{message_detection → code_check}/W0719.feature +16 -16
  207. data/features/{message_detection → code_check}/W0723.feature +6 -6
  208. data/features/code_check/W0726.feature +95 -0
  209. data/features/{message_detection → code_check}/W0732.feature +6 -6
  210. data/features/{message_detection → code_check}/W0733.feature +6 -6
  211. data/features/{message_detection → code_check}/W0734.feature +16 -16
  212. data/features/{message_detection → code_check}/W0735.feature +16 -16
  213. data/features/{message_detection → code_check}/W0745.feature +10 -10
  214. data/features/code_check/W0747.feature +146 -0
  215. data/features/code_check/W0748.feature +148 -0
  216. data/features/code_check/W0749.feature +146 -0
  217. data/features/code_check/W0750.feature +146 -0
  218. data/features/code_check/W0751.feature +148 -0
  219. data/features/code_check/W0752.feature +143 -0
  220. data/features/code_check/W0753.feature +146 -0
  221. data/features/code_check/W0754.feature +146 -0
  222. data/features/code_check/W0755.feature +142 -0
  223. data/features/code_check/W0756.feature +148 -0
  224. data/features/code_check/W0757.feature +143 -0
  225. data/features/code_check/W0758.feature +143 -0
  226. data/features/code_check/W0759.feature +154 -0
  227. data/features/code_check/W0760.feature +154 -0
  228. data/features/code_check/W0761.feature +154 -0
  229. data/features/code_check/W0762.feature +154 -0
  230. data/features/code_check/W0763.feature +156 -0
  231. data/features/code_check/W0764.feature +151 -0
  232. data/features/code_check/W0765.feature +151 -0
  233. data/features/code_check/W0766.feature +151 -0
  234. data/features/code_check/W0767.feature +142 -0
  235. data/features/code_check/W0768.feature +142 -0
  236. data/features/code_check/W0769.feature +142 -0
  237. data/features/{message_detection → code_check}/W0780.feature +12 -12
  238. data/features/code_check/W0781.feature +145 -0
  239. data/features/{message_detection → code_check}/W0783.feature +8 -8
  240. data/features/{message_detection → code_check}/W0792.feature +16 -16
  241. data/features/{message_detection → code_check}/W0793.feature +16 -16
  242. data/features/{message_detection → code_check}/W0794.feature +10 -10
  243. data/features/code_check/W0801.feature +84 -0
  244. data/features/{message_detection → code_check}/W0805.feature +14 -14
  245. data/features/code_check/W0806.feature +24 -0
  246. data/features/code_check/W0807.feature +35 -0
  247. data/features/code_check/W0808.feature +34 -0
  248. data/features/code_check/W0809.feature +114 -0
  249. data/features/{message_detection → code_check}/W0811.feature +10 -10
  250. data/features/{message_detection → code_check}/W0830.feature +12 -12
  251. data/features/{message_detection → code_check}/W0833.feature +30 -30
  252. data/features/{message_detection → code_check}/W0834.feature +26 -26
  253. data/features/{message_detection → code_check}/W1026.feature +8 -8
  254. data/features/code_check/W1030.feature +84 -0
  255. data/features/{message_detection → code_check}/W1031.feature +36 -36
  256. data/features/{message_detection → code_check}/W1039.feature +24 -24
  257. data/features/{message_detection → code_check}/W1040.feature +8 -8
  258. data/features/{message_detection → code_check}/W1041.feature +2 -2
  259. data/features/{message_detection → code_check}/W1046.feature +6 -6
  260. data/features/{message_detection → code_check}/W1047.feature +12 -12
  261. data/features/{message_detection → code_check}/W1052.feature +6 -6
  262. data/features/{message_detection → code_check}/W1066.feature +6 -6
  263. data/features/{message_detection → code_check}/W1067.feature +6 -6
  264. data/features/{message_detection → code_check}/W1068.feature +6 -6
  265. data/features/{message_detection → code_check}/W1069.feature +10 -10
  266. data/features/{message_detection → code_check}/W1070.feature +15 -15
  267. data/features/{message_detection → code_check}/W1071.feature +8 -8
  268. data/features/{message_detection → code_check}/W1072.feature +2 -2
  269. data/features/{message_detection → code_check}/W1073.feature +14 -14
  270. data/features/{message_detection → code_check}/W1074.feature +10 -10
  271. data/features/{message_detection → code_check}/W1075.feature +10 -10
  272. data/features/{message_detection → code_check}/W1076.feature +8 -8
  273. data/features/{message_detection → code_check}/W1077.feature +18 -18
  274. data/features/{message_detection → code_check}/W9001.feature +2 -2
  275. data/features/{message_detection → code_check}/W9003.feature +12 -12
  276. data/features/step_definitions/{message_detection_steps.rb → code_check_steps.rb} +1 -1
  277. data/features/support/env.rb +19 -3
  278. data/lib/adlint.rb +1 -0
  279. data/lib/adlint/analyzer.rb +17 -1
  280. data/lib/adlint/c.rb +0 -4
  281. data/lib/adlint/c/phase.rb +55 -745
  282. data/lib/adlint/code.rb +0 -24
  283. data/lib/adlint/cpp.rb +0 -3
  284. data/lib/adlint/cpp/phase.rb +50 -112
  285. data/lib/adlint/driver.rb +2 -2
  286. data/lib/adlint/error.rb +4 -4
  287. data/lib/adlint/exam.rb +143 -0
  288. data/lib/adlint/exam/c_builtin.rb +813 -0
  289. data/lib/adlint/{c/message.rb → exam/c_builtin/c_check.rb} +2130 -798
  290. data/lib/adlint/{c/message_shima.rb → exam/c_builtin/c_check_shima.rb} +99 -28
  291. data/lib/adlint/{c/code.rb → exam/c_builtin/c_code.rb} +31 -5
  292. data/lib/adlint/{c/metric.rb → exam/c_builtin/c_metric.rb} +43 -11
  293. data/lib/adlint/{cpp/message.rb → exam/c_builtin/cpp_check.rb} +177 -73
  294. data/lib/adlint/{cpp/message_shima.rb → exam/c_builtin/cpp_check_shima.rb} +28 -8
  295. data/lib/adlint/{cpp/code.rb → exam/c_builtin/cpp_code.rb} +14 -3
  296. data/lib/adlint/{ld/message.rb → exam/c_builtin/ld_check.rb} +33 -12
  297. data/lib/adlint/{ld/metric.rb → exam/c_builtin/ld_metric.rb} +8 -3
  298. data/lib/adlint/lang.rb +2 -2
  299. data/lib/adlint/ld.rb +0 -2
  300. data/lib/adlint/ld/phase.rb +101 -101
  301. data/lib/adlint/message.rb +155 -98
  302. data/lib/adlint/metric.rb +0 -27
  303. data/lib/adlint/phase.rb +28 -3
  304. data/lib/adlint/report.rb +22 -12
  305. data/lib/adlint/traits.rb +97 -5
  306. data/lib/adlint/util.rb +100 -11
  307. data/lib/adlint/version.rb +5 -5
  308. data/share/doc/developers_guide_ja.html +3 -3
  309. data/share/doc/developers_guide_ja.texi +1 -1
  310. data/share/doc/users_guide_en.html +1817 -1648
  311. data/share/doc/users_guide_en.texi +202 -22
  312. data/share/doc/users_guide_ja.html +1836 -1663
  313. data/share/doc/users_guide_ja.texi +203 -20
  314. data/share/sample/bison-2.5/adlint/adlint_traits.yml +55 -2
  315. data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +47 -2
  316. data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +47 -2
  317. data/share/sample/ctags-5.8/adlint/adlint_traits.yml +47 -2
  318. data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +47 -2
  319. data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +47 -2
  320. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +47 -2
  321. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +47 -2
  322. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +47 -2
  323. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +47 -2
  324. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +47 -2
  325. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +47 -2
  326. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +47 -2
  327. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +47 -2
  328. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +47 -2
  329. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +47 -2
  330. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +47 -2
  331. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +47 -2
  332. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +47 -2
  333. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +47 -2
  334. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +47 -2
  335. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +47 -2
  336. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +47 -2
  337. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +47 -2
  338. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +47 -2
  339. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +47 -2
  340. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +47 -2
  341. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +47 -2
  342. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +47 -2
  343. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +47 -2
  344. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +47 -2
  345. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +47 -2
  346. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +47 -2
  347. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +47 -2
  348. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +47 -2
  349. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +47 -2
  350. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +47 -2
  351. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +47 -2
  352. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +47 -2
  353. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +47 -2
  354. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +47 -2
  355. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +47 -2
  356. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +47 -2
  357. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +47 -2
  358. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +47 -2
  359. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +47 -2
  360. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +47 -2
  361. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +47 -2
  362. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +47 -2
  363. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +47 -2
  364. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +47 -2
  365. data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +47 -2
  366. data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +47 -2
  367. data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +47 -2
  368. data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +47 -2
  369. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +47 -2
  370. data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +47 -2
  371. data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +47 -2
  372. data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +47 -2
  373. data/spec/conf.d/default_traits.yml +56 -3
  374. metadata +280 -94
  375. data/etc/mesg.d/en_US/messages.yml +0 -797
  376. data/etc/mesg.d/ja_JP/messages.yml +0 -797
data/MANIFEST CHANGED
@@ -26,96 +26,279 @@ etc/conf.d/noarch/GNUmakefile.erb
26
26
  etc/conf.d/noarch/adlint_all_bat.erb
27
27
  etc/conf.d/noarch/adlint_all_sh.erb
28
28
  etc/conf.d/noarch/pinit.erb
29
- etc/mesg.d/en_US/messages.yml
30
- etc/mesg.d/ja_JP/messages.yml
31
- features/message_detection/E0013.feature
32
- features/message_detection/W0001.feature
33
- features/message_detection/W0002.feature
34
- features/message_detection/W0003.feature
35
- features/message_detection/W0007.feature
36
- features/message_detection/W0010.feature
37
- features/message_detection/W0013.feature
38
- features/message_detection/W0093.feature
39
- features/message_detection/W0104.feature
40
- features/message_detection/W0109.feature
41
- features/message_detection/W0583.feature
42
- features/message_detection/W0606.feature
43
- features/message_detection/W0641.feature
44
- features/message_detection/W0643.feature
45
- features/message_detection/W0644.feature
46
- features/message_detection/W0645.feature
47
- features/message_detection/W0646.feature
48
- features/message_detection/W0649.feature
49
- features/message_detection/W0650.feature
50
- features/message_detection/W0687.feature
51
- features/message_detection/W0688.feature
52
- features/message_detection/W0689.feature
53
- features/message_detection/W0690.feature
54
- features/message_detection/W0691.feature
55
- features/message_detection/W0692.feature
56
- features/message_detection/W0694.feature
57
- features/message_detection/W0697.feature
58
- features/message_detection/W0698.feature
59
- features/message_detection/W0699.feature
60
- features/message_detection/W0700.feature
61
- features/message_detection/W0703.feature
62
- features/message_detection/W0705.feature
63
- features/message_detection/W0707.feature
64
- features/message_detection/W0711.feature
65
- features/message_detection/W0712.feature
66
- features/message_detection/W0713.feature
67
- features/message_detection/W0714.feature
68
- features/message_detection/W0715.feature
69
- features/message_detection/W0716.feature
70
- features/message_detection/W0717.feature
71
- features/message_detection/W0718.feature
72
- features/message_detection/W0719.feature
73
- features/message_detection/W0723.feature
74
- features/message_detection/W0732.feature
75
- features/message_detection/W0733.feature
76
- features/message_detection/W0734.feature
77
- features/message_detection/W0735.feature
78
- features/message_detection/W0745.feature
79
- features/message_detection/W0780.feature
80
- features/message_detection/W0783.feature
81
- features/message_detection/W0792.feature
82
- features/message_detection/W0793.feature
83
- features/message_detection/W0794.feature
84
- features/message_detection/W0805.feature
85
- features/message_detection/W0811.feature
86
- features/message_detection/W0830.feature
87
- features/message_detection/W0833.feature
88
- features/message_detection/W0834.feature
89
- features/message_detection/W1026.feature
90
- features/message_detection/W1031.feature
91
- features/message_detection/W1039.feature
92
- features/message_detection/W1040.feature
93
- features/message_detection/W1041.feature
94
- features/message_detection/W1046.feature
95
- features/message_detection/W1047.feature
96
- features/message_detection/W1052.feature
97
- features/message_detection/W1066.feature
98
- features/message_detection/W1067.feature
99
- features/message_detection/W1068.feature
100
- features/message_detection/W1069.feature
101
- features/message_detection/W1070.feature
102
- features/message_detection/W1071.feature
103
- features/message_detection/W1072.feature
104
- features/message_detection/W1073.feature
105
- features/message_detection/W1074.feature
106
- features/message_detection/W1075.feature
107
- features/message_detection/W1076.feature
108
- features/message_detection/W1077.feature
109
- features/message_detection/W9001.feature
110
- features/message_detection/W9003.feature
111
- features/step_definitions/message_detection_steps.rb
29
+ etc/mesg.d/c_builtin/en_US/messages.yml
30
+ etc/mesg.d/c_builtin/ja_JP/messages.yml
31
+ etc/mesg.d/core/en_US/messages.yml
32
+ etc/mesg.d/core/ja_JP/messages.yml
33
+ features/code_check/E0013.feature
34
+ features/code_check/W0001.feature
35
+ features/code_check/W0002.feature
36
+ features/code_check/W0003.feature
37
+ features/code_check/W0007.feature
38
+ features/code_check/W0010.feature
39
+ features/code_check/W0013.feature
40
+ features/code_check/W0016.feature
41
+ features/code_check/W0017.feature
42
+ features/code_check/W0025.feature
43
+ features/code_check/W0026.feature
44
+ features/code_check/W0093.feature
45
+ features/code_check/W0104.feature
46
+ features/code_check/W0109.feature
47
+ features/code_check/W0119.feature
48
+ features/code_check/W0120.feature
49
+ features/code_check/W0121.feature
50
+ features/code_check/W0122.feature
51
+ features/code_check/W0123.feature
52
+ features/code_check/W0124.feature
53
+ features/code_check/W0125.feature
54
+ features/code_check/W0126.feature
55
+ features/code_check/W0127.feature
56
+ features/code_check/W0128.feature
57
+ features/code_check/W0129.feature
58
+ features/code_check/W0130.feature
59
+ features/code_check/W0131.feature
60
+ features/code_check/W0132.feature
61
+ features/code_check/W0133.feature
62
+ features/code_check/W0134.feature
63
+ features/code_check/W0135.feature
64
+ features/code_check/W0136.feature
65
+ features/code_check/W0137.feature
66
+ features/code_check/W0138.feature
67
+ features/code_check/W0139.feature
68
+ features/code_check/W0140.feature
69
+ features/code_check/W0141.feature
70
+ features/code_check/W0142.feature
71
+ features/code_check/W0143.feature
72
+ features/code_check/W0144.feature
73
+ features/code_check/W0145.feature
74
+ features/code_check/W0146.feature
75
+ features/code_check/W0147.feature
76
+ features/code_check/W0148.feature
77
+ features/code_check/W0149.feature
78
+ features/code_check/W0150.feature
79
+ features/code_check/W0151.feature
80
+ features/code_check/W0152.feature
81
+ features/code_check/W0153.feature
82
+ features/code_check/W0154.feature
83
+ features/code_check/W0155.feature
84
+ features/code_check/W0156.feature
85
+ features/code_check/W0157.feature
86
+ features/code_check/W0158.feature
87
+ features/code_check/W0159.feature
88
+ features/code_check/W0160.feature
89
+ features/code_check/W0161.feature
90
+ features/code_check/W0162.feature
91
+ features/code_check/W0163.feature
92
+ features/code_check/W0164.feature
93
+ features/code_check/W0165.feature
94
+ features/code_check/W0166.feature
95
+ features/code_check/W0167.feature
96
+ features/code_check/W0168.feature
97
+ features/code_check/W0169.feature
98
+ features/code_check/W0170.feature
99
+ features/code_check/W0171.feature
100
+ features/code_check/W0172.feature
101
+ features/code_check/W0173.feature
102
+ features/code_check/W0174.feature
103
+ features/code_check/W0175.feature
104
+ features/code_check/W0176.feature
105
+ features/code_check/W0177.feature
106
+ features/code_check/W0178.feature
107
+ features/code_check/W0179.feature
108
+ features/code_check/W0180.feature
109
+ features/code_check/W0181.feature
110
+ features/code_check/W0182.feature
111
+ features/code_check/W0183.feature
112
+ features/code_check/W0184.feature
113
+ features/code_check/W0185.feature
114
+ features/code_check/W0186.feature
115
+ features/code_check/W0187.feature
116
+ features/code_check/W0188.feature
117
+ features/code_check/W0189.feature
118
+ features/code_check/W0190.feature
119
+ features/code_check/W0191.feature
120
+ features/code_check/W0192.feature
121
+ features/code_check/W0193.feature
122
+ features/code_check/W0194.feature
123
+ features/code_check/W0195.feature
124
+ features/code_check/W0196.feature
125
+ features/code_check/W0197.feature
126
+ features/code_check/W0198.feature
127
+ features/code_check/W0199.feature
128
+ features/code_check/W0200.feature
129
+ features/code_check/W0201.feature
130
+ features/code_check/W0202.feature
131
+ features/code_check/W0203.feature
132
+ features/code_check/W0204.feature
133
+ features/code_check/W0205.feature
134
+ features/code_check/W0206.feature
135
+ features/code_check/W0207.feature
136
+ features/code_check/W0208.feature
137
+ features/code_check/W0209.feature
138
+ features/code_check/W0210.feature
139
+ features/code_check/W0211.feature
140
+ features/code_check/W0212.feature
141
+ features/code_check/W0213.feature
142
+ features/code_check/W0214.feature
143
+ features/code_check/W0215.feature
144
+ features/code_check/W0216.feature
145
+ features/code_check/W0217.feature
146
+ features/code_check/W0218.feature
147
+ features/code_check/W0219.feature
148
+ features/code_check/W0220.feature
149
+ features/code_check/W0221.feature
150
+ features/code_check/W0222.feature
151
+ features/code_check/W0223.feature
152
+ features/code_check/W0224.feature
153
+ features/code_check/W0225.feature
154
+ features/code_check/W0226.feature
155
+ features/code_check/W0227.feature
156
+ features/code_check/W0228.feature
157
+ features/code_check/W0229.feature
158
+ features/code_check/W0230.feature
159
+ features/code_check/W0231.feature
160
+ features/code_check/W0232.feature
161
+ features/code_check/W0233.feature
162
+ features/code_check/W0234.feature
163
+ features/code_check/W0235.feature
164
+ features/code_check/W0236.feature
165
+ features/code_check/W0237.feature
166
+ features/code_check/W0238.feature
167
+ features/code_check/W0239.feature
168
+ features/code_check/W0240.feature
169
+ features/code_check/W0241.feature
170
+ features/code_check/W0242.feature
171
+ features/code_check/W0243.feature
172
+ features/code_check/W0244.feature
173
+ features/code_check/W0245.feature
174
+ features/code_check/W0246.feature
175
+ features/code_check/W0247.feature
176
+ features/code_check/W0248.feature
177
+ features/code_check/W0249.feature
178
+ features/code_check/W0250.feature
179
+ features/code_check/W0251.feature
180
+ features/code_check/W0252.feature
181
+ features/code_check/W0253.feature
182
+ features/code_check/W0254.feature
183
+ features/code_check/W0477.feature
184
+ features/code_check/W0478.feature
185
+ features/code_check/W0479.feature
186
+ features/code_check/W0480.feature
187
+ features/code_check/W0481.feature
188
+ features/code_check/W0482.feature
189
+ features/code_check/W0483.feature
190
+ features/code_check/W0573.feature
191
+ features/code_check/W0583.feature
192
+ features/code_check/W0606.feature
193
+ features/code_check/W0641.feature
194
+ features/code_check/W0643.feature
195
+ features/code_check/W0644.feature
196
+ features/code_check/W0645.feature
197
+ features/code_check/W0646.feature
198
+ features/code_check/W0649.feature
199
+ features/code_check/W0650.feature
200
+ features/code_check/W0685.feature
201
+ features/code_check/W0686.feature
202
+ features/code_check/W0687.feature
203
+ features/code_check/W0688.feature
204
+ features/code_check/W0689.feature
205
+ features/code_check/W0690.feature
206
+ features/code_check/W0691.feature
207
+ features/code_check/W0692.feature
208
+ features/code_check/W0694.feature
209
+ features/code_check/W0695.feature
210
+ features/code_check/W0697.feature
211
+ features/code_check/W0698.feature
212
+ features/code_check/W0699.feature
213
+ features/code_check/W0700.feature
214
+ features/code_check/W0703.feature
215
+ features/code_check/W0705.feature
216
+ features/code_check/W0707.feature
217
+ features/code_check/W0711.feature
218
+ features/code_check/W0712.feature
219
+ features/code_check/W0713.feature
220
+ features/code_check/W0714.feature
221
+ features/code_check/W0715.feature
222
+ features/code_check/W0716.feature
223
+ features/code_check/W0717.feature
224
+ features/code_check/W0718.feature
225
+ features/code_check/W0719.feature
226
+ features/code_check/W0723.feature
227
+ features/code_check/W0726.feature
228
+ features/code_check/W0732.feature
229
+ features/code_check/W0733.feature
230
+ features/code_check/W0734.feature
231
+ features/code_check/W0735.feature
232
+ features/code_check/W0745.feature
233
+ features/code_check/W0747.feature
234
+ features/code_check/W0748.feature
235
+ features/code_check/W0749.feature
236
+ features/code_check/W0750.feature
237
+ features/code_check/W0751.feature
238
+ features/code_check/W0752.feature
239
+ features/code_check/W0753.feature
240
+ features/code_check/W0754.feature
241
+ features/code_check/W0755.feature
242
+ features/code_check/W0756.feature
243
+ features/code_check/W0757.feature
244
+ features/code_check/W0758.feature
245
+ features/code_check/W0759.feature
246
+ features/code_check/W0760.feature
247
+ features/code_check/W0761.feature
248
+ features/code_check/W0762.feature
249
+ features/code_check/W0763.feature
250
+ features/code_check/W0764.feature
251
+ features/code_check/W0765.feature
252
+ features/code_check/W0766.feature
253
+ features/code_check/W0767.feature
254
+ features/code_check/W0768.feature
255
+ features/code_check/W0769.feature
256
+ features/code_check/W0780.feature
257
+ features/code_check/W0781.feature
258
+ features/code_check/W0783.feature
259
+ features/code_check/W0792.feature
260
+ features/code_check/W0793.feature
261
+ features/code_check/W0794.feature
262
+ features/code_check/W0801.feature
263
+ features/code_check/W0805.feature
264
+ features/code_check/W0806.feature
265
+ features/code_check/W0807.feature
266
+ features/code_check/W0808.feature
267
+ features/code_check/W0809.feature
268
+ features/code_check/W0811.feature
269
+ features/code_check/W0830.feature
270
+ features/code_check/W0833.feature
271
+ features/code_check/W0834.feature
272
+ features/code_check/W1026.feature
273
+ features/code_check/W1030.feature
274
+ features/code_check/W1031.feature
275
+ features/code_check/W1039.feature
276
+ features/code_check/W1040.feature
277
+ features/code_check/W1041.feature
278
+ features/code_check/W1046.feature
279
+ features/code_check/W1047.feature
280
+ features/code_check/W1052.feature
281
+ features/code_check/W1066.feature
282
+ features/code_check/W1067.feature
283
+ features/code_check/W1068.feature
284
+ features/code_check/W1069.feature
285
+ features/code_check/W1070.feature
286
+ features/code_check/W1071.feature
287
+ features/code_check/W1072.feature
288
+ features/code_check/W1073.feature
289
+ features/code_check/W1074.feature
290
+ features/code_check/W1075.feature
291
+ features/code_check/W1076.feature
292
+ features/code_check/W1077.feature
293
+ features/code_check/W9001.feature
294
+ features/code_check/W9003.feature
295
+ features/step_definitions/code_check_steps.rb
112
296
  features/support/env.rb
113
297
  lib/adlint.rb
114
298
  lib/adlint/analyzer.rb
115
299
  lib/adlint/c.rb
116
300
  lib/adlint/c/branch.rb
117
301
  lib/adlint/c/builtin.rb
118
- lib/adlint/c/code.rb
119
302
  lib/adlint/c/const.rb
120
303
  lib/adlint/c/conv.rb
121
304
  lib/adlint/c/ctrlexpr.rb
@@ -127,9 +310,6 @@ lib/adlint/c/format.rb
127
310
  lib/adlint/c/interp.rb
128
311
  lib/adlint/c/lexer.rb
129
312
  lib/adlint/c/mediator.rb
130
- lib/adlint/c/message.rb
131
- lib/adlint/c/message_shima.rb
132
- lib/adlint/c/metric.rb
133
313
  lib/adlint/c/object.rb
134
314
  lib/adlint/c/operator.rb
135
315
  lib/adlint/c/option.rb
@@ -147,14 +327,11 @@ lib/adlint/c/value.rb
147
327
  lib/adlint/code.rb
148
328
  lib/adlint/cpp.rb
149
329
  lib/adlint/cpp/asm.rb
150
- lib/adlint/cpp/code.rb
151
330
  lib/adlint/cpp/constexpr.rb
152
331
  lib/adlint/cpp/constexpr.y
153
332
  lib/adlint/cpp/eval.rb
154
333
  lib/adlint/cpp/lexer.rb
155
334
  lib/adlint/cpp/macro.rb
156
- lib/adlint/cpp/message.rb
157
- lib/adlint/cpp/message_shima.rb
158
335
  lib/adlint/cpp/phase.rb
159
336
  lib/adlint/cpp/scanner.rb
160
337
  lib/adlint/cpp/source.rb
@@ -163,10 +340,19 @@ lib/adlint/cpp/syntax.rb
163
340
  lib/adlint/cpp/util.rb
164
341
  lib/adlint/driver.rb
165
342
  lib/adlint/error.rb
343
+ lib/adlint/exam.rb
344
+ lib/adlint/exam/c_builtin.rb
345
+ lib/adlint/exam/c_builtin/c_check.rb
346
+ lib/adlint/exam/c_builtin/c_check_shima.rb
347
+ lib/adlint/exam/c_builtin/c_code.rb
348
+ lib/adlint/exam/c_builtin/c_metric.rb
349
+ lib/adlint/exam/c_builtin/cpp_check.rb
350
+ lib/adlint/exam/c_builtin/cpp_check_shima.rb
351
+ lib/adlint/exam/c_builtin/cpp_code.rb
352
+ lib/adlint/exam/c_builtin/ld_check.rb
353
+ lib/adlint/exam/c_builtin/ld_metric.rb
166
354
  lib/adlint/lang.rb
167
355
  lib/adlint/ld.rb
168
- lib/adlint/ld/message.rb
169
- lib/adlint/ld/metric.rb
170
356
  lib/adlint/ld/object.rb
171
357
  lib/adlint/ld/phase.rb
172
358
  lib/adlint/ld/typedef.rb
data/NEWS CHANGED
@@ -21,17 +21,29 @@
21
21
 
22
22
  ++
23
23
 
24
- === \AdLint 1.18.6 is released (2012-08-14)
24
+ === \AdLint 2.0.0 is released (2012-08-22)
25
25
 
26
- ==== Changes since the 1.18.2 release
26
+ ==== Changes since the 1.18.6 release
27
27
 
28
- * Fix abend problem when a variable of typedefed incomplete array type is
29
- defined with an initializer
28
+ * In preparation for using optional source code examination packages, refine
29
+ internal module structure and revise format of the traits file
30
+ * Revise format of the traits file and the message definition file in
31
+ preparation for supporting selective code check feature
32
+ * Revise format of the traits file in preparation for supporting warning
33
+ suppression of unconcerned headers such as system headers
34
+ * Add many more functional specifications of builtin code checks
30
35
 
31
36
  See the file
32
37
  {ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
33
38
  for more details.
34
39
 
40
+ === \AdLint 1.18.6 is released (2012-08-14)
41
+
42
+ ==== Changes since the 1.18.2 release
43
+
44
+ * Fix abend problem when a variable of typedefed incomplete array type is
45
+ defined with an initializer
46
+
35
47
  === \AdLint 1.18.2 is released (2012-08-03)
36
48
 
37
49
  ==== Changes since the 1.18.0 release
data/bin/adlintize CHANGED
@@ -69,6 +69,7 @@ Options:
69
69
  --version Display version information
70
70
  --copyright Display copyright information
71
71
  --prefix Display prefix directory of AdLint
72
+ --migrate FILE Migrate format of the specified traits file
72
73
  -h, --help Display this message
73
74
  EOS
74
75
 
@@ -86,6 +87,123 @@ def print_environments
86
87
  end
87
88
  end
88
89
 
90
+ # TODO: Refine this ad-hoc schema migration.
91
+ def migrate_traits_schema(traits_fpath)
92
+ unless traits_fpath.exist? && traits_fpath.file?
93
+ $stderr.puts "#{File.basename(__FILE__)} : no such traits file"
94
+ exit 1
95
+ end
96
+
97
+ contents = File.open(traits_fpath, "r:utf-8") { |io| io.read }
98
+ return unless contents =~ /^version: "1\.0\.0"$/
99
+
100
+ backup_traits_file(traits_fpath, %w(.orig .old .mig))
101
+ File.open(traits_fpath, "w:utf-8") do |io|
102
+ io.puts "# Traits file migrated by adlintize #{AdLint::SHORT_VERSION}.", ""
103
+ change_list = []
104
+ contents.lines.map { |str| str.chomp }.each do |line|
105
+ case line
106
+ when /\Aversion:/
107
+ io.puts "version: \"2.0.0\"", ""
108
+ io.puts <<EOS
109
+ # List of names of source code examination packages.
110
+ #
111
+ # "c_builtin" is a builtin source code examination package for C language.
112
+ # You can install optional examination packages and append (or replace) this
113
+ # list to specify which examination packages are to be run.
114
+ exam_packages:
115
+ - "c_builtin"
116
+ EOS
117
+ when /\Amessage_traits:/
118
+ io.puts <<EOS
119
+ message_traits:
120
+
121
+ # Output messages with category and severity information?
122
+ message_with_class: false
123
+
124
+ # Warn only files in the specified directory. If omitted, all files (such as
125
+ # system headers or 3rd-party library headers) will be warned.
126
+ warn_only_files_in:
127
+
128
+ # Enable translation-unit specific code check selection?
129
+ individual_selection: true
130
+
131
+ # Project-wide code check exclusion settings.
132
+ # Ex.
133
+ # exclusion:
134
+ # categories:
135
+ # - "REL"
136
+ # - "PRT"
137
+ # severities: "[ABC][5-9][0-9]"
138
+ # messages:
139
+ # W0001: "c_builtin"
140
+ # W0002: "c_ansi"
141
+ exclusion:
142
+
143
+ # Project-wide code check inclusion settings.
144
+ # Ex.
145
+ # inclusion:
146
+ # messages:
147
+ # W0001: "c_builtin"
148
+ # W0002: "c_ansi"
149
+ inclusion:
150
+ EOS
151
+ when /\A change_list:/, /\A [WCEX]\d{4}\s*:/
152
+ # NOTE: change_list will be migrated later.
153
+ change_list.push(line)
154
+ else
155
+ io.puts line
156
+ end
157
+ end
158
+
159
+ change_list.each do |line|
160
+ case line
161
+ when /\A change_list:/
162
+ io.puts <<EOS
163
+ # Message text replacement for AdLint 2.0.0 or later.
164
+ # Ex.
165
+ # change_list:
166
+ # W9999:
167
+ # package: "c_builtin"
168
+ # classes:
169
+ # - "REL:A10"
170
+ # - "PRT:B20"
171
+ # format: "Your custom message for the warning of W9999."
172
+ # X9999:
173
+ # package: "core"
174
+ # classes:
175
+ # - "ERR:X99"
176
+ # format: "Your custom message for the warning of X9999."
177
+ # E9999:
178
+ # package: "core"
179
+ # classes:
180
+ # - "ERR:X99"
181
+ # format: "Your custom message for the warning of E9999."
182
+ change_list:
183
+ EOS
184
+ when /\A ([WCEX]\d{4})\s*:(.*)\z/
185
+ io.puts <<EOS
186
+ #{$1}:
187
+ package: "c_builtin"
188
+ classes:
189
+ - "UNC:X99"
190
+ format:#{$2}
191
+ EOS
192
+ end
193
+ end
194
+ end
195
+ end
196
+
197
+ def backup_traits_file(traits_fpath, suffixes)
198
+ suffixes.each do |suffix|
199
+ backup_fpath = Pathname.new("#{traits_fpath}#{suffix}")
200
+ unless backup_fpath.exist?
201
+ FileUtils.cp(traits_fpath, backup_fpath)
202
+ break
203
+ end
204
+ end
205
+ end
206
+
89
207
  require "getoptlong"
90
208
 
91
209
  parser = GetoptLong.new(["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
@@ -102,6 +220,7 @@ parser = GetoptLong.new(["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
102
220
  ["--version", GetoptLong::NO_ARGUMENT],
103
221
  ["--copyright", GetoptLong::NO_ARGUMENT],
104
222
  ["--prefix", GetoptLong::NO_ARGUMENT],
223
+ ["--migrate", GetoptLong::REQUIRED_ARGUMENT],
105
224
  ["--help", "-h", GetoptLong::NO_ARGUMENT])
106
225
 
107
226
  begin
@@ -150,6 +269,9 @@ begin
150
269
  when "--prefix"
151
270
  puts $prefix
152
271
  exit 0
272
+ when "--migrate"
273
+ migrate_traits_schema(Pathname.new(value))
274
+ exit 0
153
275
  when "--help"
154
276
  puts $usage
155
277
  exit 0
@@ -162,7 +284,8 @@ end
162
284
 
163
285
  project_name = ARGV.empty? ? Pathname.getwd.each_filename.to_a.last : ARGV[0]
164
286
 
165
- FileUtils.mkdir_p(output_dpath) if output_dpath && !Dir.exist?(output_dpath)
287
+ FileUtils.mkdir_p(output_dpath) unless Dir.exist?(output_dpath)
288
+ vpath = Pathname.pwd.relative_path_from(Pathname.new(output_dpath).realpath)
166
289
 
167
290
  traits_fpath = traits_fpath.expand_path(output_dpath)
168
291
  pinit_fpath = pinit_fpath.expand_path(output_dpath)
@@ -241,8 +364,6 @@ else
241
364
  exit 1
242
365
  end
243
366
 
244
- vpath = Pathname.pwd.relative_path_from(Pathname.new(output_dpath).realpath)
245
-
246
367
  if !File.exist?(list_fpath) || force_overwrite
247
368
  File.open(list_fpath, "w") do |io|
248
369
  io.set_encoding(Encoding::UTF_8)