adlint 2.6.12 → 2.6.14
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +77 -0
- data/NEWS +17 -4
- data/bin/adlint +24 -30
- data/bin/adlint_chk +22 -28
- data/bin/adlint_cma +20 -26
- data/bin/adlint_sma +22 -28
- data/bin/adlintize +60 -58
- data/etc/mesg.d/c_builtin/en_US/messages.yml +168 -168
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +168 -168
- data/etc/mesg.d/core/en_US/messages.yml +1 -1
- data/etc/mesg.d/core/ja_JP/messages.yml +1 -1
- data/features/code_check/W0119.feature +0 -5
- data/features/code_check/W0120.feature +1 -0
- data/features/code_check/W0121.feature +0 -5
- data/features/code_check/W0123.feature +0 -5
- data/features/code_check/W0125.feature +0 -5
- data/features/code_check/W0127.feature +0 -5
- data/features/code_check/W0128.feature +0 -5
- data/features/code_check/W0129.feature +0 -5
- data/features/code_check/W0130.feature +0 -5
- data/features/code_check/W0132.feature +1 -0
- data/features/code_check/W0133.feature +0 -5
- data/features/code_check/W0134.feature +0 -5
- data/features/code_check/W0135.feature +0 -5
- data/features/code_check/W0136.feature +0 -5
- data/features/code_check/W0137.feature +0 -5
- data/features/code_check/W0138.feature +0 -5
- data/features/code_check/W0139.feature +0 -5
- data/features/code_check/W0140.feature +0 -5
- data/features/code_check/W0141.feature +0 -5
- data/features/code_check/W0142.feature +0 -5
- data/features/code_check/W0157.feature +0 -5
- data/features/code_check/W0161.feature +0 -5
- data/features/code_check/W0165.feature +0 -5
- data/features/code_check/W0169.feature +0 -5
- data/features/code_check/W0177.feature +0 -5
- data/features/code_check/W0182.feature +0 -5
- data/features/code_check/W0183.feature +0 -5
- data/features/code_check/W0184.feature +0 -5
- data/features/code_check/W0212.feature +0 -5
- data/features/code_check/W0214.feature +0 -5
- data/features/code_check/W0221.feature +0 -5
- data/features/code_check/W0223.feature +0 -5
- data/features/code_check/W0230.feature +0 -5
- data/features/code_check/W0232.feature +0 -5
- data/features/code_check/W0245.feature +0 -5
- data/features/code_check/W0246.feature +0 -5
- data/features/code_check/W0247.feature +0 -5
- data/features/code_check/W0251.feature +0 -5
- data/features/code_check/W0650.feature +0 -4
- data/features/code_check/W0703.feature +5 -1
- data/features/code_check/W0719.feature +0 -10
- data/features/code_check/W0748.feature +0 -5
- data/features/code_check/W0751.feature +0 -5
- data/features/code_check/W0756.feature +0 -5
- data/features/code_check/W0763.feature +0 -5
- data/features/code_check/W0787.feature +7 -0
- data/features/code_check/W0794.feature +0 -1
- data/features/code_check/W1052.feature +0 -2
- data/features/support/env.rb +2 -7
- data/lib/adlint/c/syntax.rb +10 -16
- data/lib/adlint/cpp/macro.rb +96 -0
- data/lib/adlint/exam/c_builtin/c_check.rb +954 -817
- data/lib/adlint/exam/c_builtin/c_check_shima.rb +17 -19
- data/lib/adlint/exam/c_builtin/ld_check.rb +86 -44
- data/lib/adlint/message.rb +1 -1
- data/lib/adlint/util.rb +8 -8
- data/lib/adlint/version.rb +2 -2
- data/lib/adlint.rb +8 -0
- data/share/doc/developers_guide_ja.html +3 -3
- data/share/doc/developers_guide_ja.texi +1 -1
- data/share/doc/users_guide_en.html +5055 -5053
- data/share/doc/users_guide_en.texi +3817 -3818
- data/share/doc/users_guide_ja.html +3787 -3786
- data/share/doc/users_guide_ja.texi +3784 -3783
- data/spec/spec_helper.rb +3 -11
- metadata +2 -2
data/bin/adlintize
CHANGED
@@ -31,20 +31,12 @@
|
|
31
31
|
#
|
32
32
|
#++
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
$bindir = Pathname.new(__FILE__).realpath.dirname
|
37
|
-
$prefix = Pathname.new("..").expand_path($bindir)
|
38
|
-
$libdir = Pathname.new("lib").expand_path($prefix)
|
39
|
-
$etcdir = Pathname.new("etc").expand_path($prefix)
|
40
|
-
|
41
|
-
$:.unshift($libdir.to_s)
|
42
|
-
|
34
|
+
$LOAD_PATH.unshift(File.expand_path("../lib", File.dirname(__FILE__)))
|
43
35
|
require "adlint"
|
44
36
|
|
45
|
-
|
37
|
+
version = "AdLint project generator #{AdLint::VERSION}"
|
46
38
|
|
47
|
-
|
39
|
+
usage = <<EOS
|
48
40
|
Usage: adlintize [options] [project-name]
|
49
41
|
Options:
|
50
42
|
-t FILE, --traits FILE Write traits to FILE
|
@@ -74,13 +66,15 @@ Options:
|
|
74
66
|
EOS
|
75
67
|
|
76
68
|
def print_environments
|
77
|
-
|
69
|
+
conf_dpath = Pathname.new("conf.d").expand_path(AdLint::Config[:etcdir])
|
70
|
+
Dir.entries(conf_dpath).each do |dirent|
|
78
71
|
case dirent
|
79
72
|
when ".", "..", "fallback", "noarch"
|
80
73
|
next
|
81
74
|
end
|
82
75
|
|
83
|
-
|
76
|
+
traits_pattern = "#{AdLint::Config[:etcdir]}/conf.d/#{dirent}/traits-*.erb"
|
77
|
+
Dir.glob(traits_pattern).each do |traits_fpath|
|
84
78
|
basename = File.basename(traits_fpath, ".erb")
|
85
79
|
puts "#{dirent}-#{basename.sub(/\Atraits-/, "")}"
|
86
80
|
end
|
@@ -269,33 +263,35 @@ end
|
|
269
263
|
|
270
264
|
require "getoptlong"
|
271
265
|
|
272
|
-
parser = GetoptLong.new(
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
266
|
+
parser = GetoptLong.new(
|
267
|
+
["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
|
268
|
+
["--pinit-hdr", "-p", GetoptLong::REQUIRED_ARGUMENT],
|
269
|
+
["--cinit-hdr", "-c", GetoptLong::REQUIRED_ARGUMENT],
|
270
|
+
["--list-file", "-l", GetoptLong::REQUIRED_ARGUMENT],
|
271
|
+
["--makefile", "-m", GetoptLong::REQUIRED_ARGUMENT],
|
272
|
+
["--sh-script", "-s", GetoptLong::REQUIRED_ARGUMENT],
|
273
|
+
["--bat-file", "-b", GetoptLong::REQUIRED_ARGUMENT],
|
274
|
+
["--output-dir", "-o", GetoptLong::REQUIRED_ARGUMENT],
|
275
|
+
["--environment", "-e", GetoptLong::REQUIRED_ARGUMENT],
|
276
|
+
["--list-environment", "-L", GetoptLong::NO_ARGUMENT],
|
277
|
+
["--force", "-f", GetoptLong::NO_ARGUMENT],
|
278
|
+
["--version", GetoptLong::NO_ARGUMENT],
|
279
|
+
["--copyright", GetoptLong::NO_ARGUMENT],
|
280
|
+
["--prefix", GetoptLong::NO_ARGUMENT],
|
281
|
+
["--migrate", GetoptLong::REQUIRED_ARGUMENT],
|
282
|
+
["--help", "-h", GetoptLong::NO_ARGUMENT]
|
283
|
+
)
|
288
284
|
|
289
285
|
begin
|
290
|
-
traits_fpath
|
291
|
-
pinit_fpath
|
292
|
-
cinit_fpath
|
293
|
-
list_fpath
|
294
|
-
make_fpath
|
295
|
-
sh_fpath
|
296
|
-
bat_fpath
|
297
|
-
output_dpath
|
298
|
-
environment
|
286
|
+
traits_fpath = Pathname.new("adlint_traits.yml")
|
287
|
+
pinit_fpath = Pathname.new("adlint_pinit.h")
|
288
|
+
cinit_fpath = Pathname.new("adlint_cinit.h")
|
289
|
+
list_fpath = Pathname.new("adlint_files.txt")
|
290
|
+
make_fpath = Pathname.new("GNUmakefile")
|
291
|
+
sh_fpath = Pathname.new("adlint_all.sh")
|
292
|
+
bat_fpath = Pathname.new("adlint_all.bat")
|
293
|
+
output_dpath = Pathname.new(".")
|
294
|
+
environment = nil
|
299
295
|
force_overwrite = false
|
300
296
|
|
301
297
|
parser.each do |option, value|
|
@@ -324,24 +320,24 @@ begin
|
|
324
320
|
when "--force"
|
325
321
|
force_overwrite = true
|
326
322
|
when "--version"
|
327
|
-
puts
|
323
|
+
puts version, AdLint::AUTHOR
|
328
324
|
exit 0
|
329
325
|
when "--copyright"
|
330
326
|
puts AdLint::COPYRIGHT
|
331
327
|
exit 0
|
332
328
|
when "--prefix"
|
333
|
-
puts
|
329
|
+
puts AdLint::Config[:prefix]
|
334
330
|
exit 0
|
335
331
|
when "--migrate"
|
336
332
|
migrate_traits_schema(Pathname.new(value))
|
337
333
|
exit 0
|
338
334
|
when "--help"
|
339
|
-
puts
|
335
|
+
puts usage
|
340
336
|
exit 0
|
341
337
|
end
|
342
338
|
end
|
343
339
|
rescue
|
344
|
-
$stderr.puts
|
340
|
+
$stderr.puts usage
|
345
341
|
exit 1
|
346
342
|
end
|
347
343
|
|
@@ -351,38 +347,44 @@ FileUtils.mkdir_p(output_dpath) unless Dir.exist?(output_dpath)
|
|
351
347
|
vpath = Pathname.pwd.relative_path_from(Pathname.new(output_dpath).realpath)
|
352
348
|
|
353
349
|
traits_fpath = traits_fpath.expand_path(output_dpath)
|
354
|
-
pinit_fpath
|
355
|
-
cinit_fpath
|
356
|
-
list_fpath
|
357
|
-
make_fpath
|
358
|
-
sh_fpath
|
359
|
-
bat_fpath
|
350
|
+
pinit_fpath = pinit_fpath.expand_path(output_dpath)
|
351
|
+
cinit_fpath = cinit_fpath.expand_path(output_dpath)
|
352
|
+
list_fpath = list_fpath.expand_path(output_dpath)
|
353
|
+
make_fpath = make_fpath.expand_path(output_dpath)
|
354
|
+
sh_fpath = sh_fpath.expand_path(output_dpath)
|
355
|
+
bat_fpath = bat_fpath.expand_path(output_dpath)
|
360
356
|
|
361
357
|
if environment
|
362
358
|
arch, os, compiler = environment.split("-")
|
363
359
|
|
364
|
-
cinit_templ_fpath =
|
365
|
-
|
360
|
+
cinit_templ_fpath = Pathname.new(
|
361
|
+
"#{AdLint::Config[:etcdir]}/conf.d/#{arch}-#{os}/cinit-#{compiler}.erb")
|
366
362
|
unless File.readable?(cinit_templ_fpath)
|
367
363
|
$stderr.puts "#{File.basename(__FILE__)}: no such preset build environment"
|
368
364
|
exit 1
|
369
365
|
end
|
370
366
|
|
371
|
-
traits_templ_fpath =
|
372
|
-
|
367
|
+
traits_templ_fpath = Pathname.new(
|
368
|
+
"#{AdLint::Config[:etcdir]}/conf.d/#{arch}-#{os}/traits-#{compiler}.erb")
|
373
369
|
unless File.readable?(traits_templ_fpath)
|
374
370
|
$stderr.puts "#{File.basename(__FILE__)}: no such preset build environment"
|
375
371
|
exit 1
|
376
372
|
end
|
377
373
|
else
|
378
|
-
cinit_templ_fpath = Pathname.new(
|
379
|
-
|
374
|
+
cinit_templ_fpath = Pathname.new(
|
375
|
+
"#{AdLint::Config[:etcdir]}/conf.d/fallback/cinit.erb")
|
376
|
+
traits_templ_fpath = Pathname.new(
|
377
|
+
"#{AdLint::Config[:etcdir]}/conf.d/fallback/traits.erb")
|
380
378
|
end
|
381
379
|
|
382
|
-
pinit_templ_fpath = Pathname.new(
|
383
|
-
|
384
|
-
|
385
|
-
|
380
|
+
pinit_templ_fpath = Pathname.new(
|
381
|
+
"#{AdLint::Config[:etcdir]}/conf.d/noarch/pinit.erb")
|
382
|
+
make_templ_fpath = Pathname.new(
|
383
|
+
"#{AdLint::Config[:etcdir]}/conf.d/noarch/GNUmakefile.erb")
|
384
|
+
sh_templ_fpath = Pathname.new(
|
385
|
+
"#{AdLint::Config[:etcdir]}/conf.d/noarch/adlint_all_sh.erb")
|
386
|
+
bat_templ_fpath = Pathname.new(
|
387
|
+
"#{AdLint::Config[:etcdir]}/conf.d/noarch/adlint_all_bat.erb")
|
386
388
|
|
387
389
|
require "erb"
|
388
390
|
|