Module: AdLint::Postfilter

Defined in:
lib/adlint/postfilter/path.rb,
lib/adlint/postfilter/config.rb,
lib/adlint/postfilter/driver.rb,
lib/adlint/postfilter/filter.rb,
lib/adlint/postfilter/command.rb,
lib/adlint/postfilter/content.rb,
lib/adlint/postfilter/version.rb,
lib/adlint/postfilter/annotate.rb,
lib/adlint/postfilter/suppress.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Deactivatable, PathUtil Classes: ADLINT, ADLINT_CHK, ADLINT_CMA, ADLINT_SMA, AdLintInitialHeaderSuppression, AnalysisCommand, CmaConfig, Config, CsvMessageLine, FileWiseSuppression, FilteringContent, Line, LineWiseAnnotation, LineWiseSuppression, MessageControl, MessageControlAnnotation, MessageController, MessageFileContent, MessageFilter, MessageLine, MessageSuppression, MessageSuppressionActivation, MessageSuppressionDeactivation, MessageSuppressionList, MessageWiseSuppression, OrdinaryLine, PlainMessageLine, PlatformHeaderSuppression, ProjectWideSuppression, SmaConfig, StderrContent, TranslationUnitWideAnnotation

Constant Summary collapse

MAJOR_VERSION =

:nodoc:

1
MINOR_VERSION =
1
PATCH_VERSION =
0
RELEASE_DATE =
"2012-04-18"
SHORT_VERSION =
"#{MAJOR_VERSION}.#{MINOR_VERSION}.#{PATCH_VERSION}"
VERSION =
"#{SHORT_VERSION} (#{RELEASE_DATE})"
<<EOS
     ___    ____  __    ___   _________
    /   |  / _  |/ /   / / | / /__  __/            Source Code Static Analyzer
   / /| | / / / / /   / /  |/ /  / /                    AdLint - Advanced Lint
  / __  |/ /_/ / /___/ / /|  /  / /
 /_/  |_|_____/_____/_/_/ |_/  /_/    Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.

 adlint-postfilter is free software: you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the Free
 Software Foundation, either version 3 of the License, or (at your option) any
 later version.

 adlint-postfilter is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 details.

 You should have received a copy of the GNU General Public License along with
 adlint-postfilter.  If not, see <http://www.gnu.org/licenses/>.

EOS
AUTHOR =
<<EOS
Written by Yutaka Yanoh and OGIS-RI Co.,Ltd.

EOS

Class Method Summary collapse

Class Method Details

.install_config_template(config_fpath) ⇒ Object



40
41
42
43
# File 'lib/adlint/postfilter/driver.rb', line 40

def install_config_template(config_fpath)
  FileUtils.cp(File.expand_path("conf.d/adlint_postfilter.yml", $etcdir),
               config_fpath)
end

.run(config_fpath, command_line, src_vpath) ⇒ Object



69
70
71
72
# File 'lib/adlint/postfilter/driver.rb', line 69

def run(config_fpath, command_line, src_vpath)
  command = AnalysisCommand.for(command_line, config_fpath, src_vpath)
  command.execute.exitstatus
end

.transform_makefile(makefile_fpath) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/adlint/postfilter/driver.rb', line 46

def transform_makefile(makefile_fpath)
  orig_fpath = makefile_fpath.add_ext(".orig")
  FileUtils.mv(makefile_fpath, orig_fpath)

  File.open(makefile_fpath, "w") do |dst_io|
    dst_io.puts File.open(orig_fpath, "r") { |src_io|
      src_io.each_line.map do |line|
        case line
        when /^(ADLINT =) (.*adlint)$/,
             /^(ADLINT_SMA =) (.*adlint_sma)$/,
             /^(ADLINT_CHK =) (.*adlint_chk)$/
          "#{$1} adlint_flt -A #{$2}"
        when /^(ADLINT_CMA =) (.*adlint_cma)$/
          "#{$1} adlint_flt -V $(VPATH) -A #{$2}"
        else
          line.chomp
        end
      end
    }
  end
end