schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 199 forks source link

[Config file] <table-exclusion-pattern> value is lost when java method configure is overridden #37

Closed mbarre closed 8 years ago

mbarre commented 8 years ago

I tried to exclude some tables from the lints.

I realized that my linter java classes that override the method configure ignore the <table-exclusion-pattern> value in the config file.

  <linter id="io.github.mbarre.schemacrawler.tool.linter.LinterColumnContentNotNormalized">
        <run>true</run>
        <table-exclusion-pattern><![CDATA[pdc_adm\.((databasechangeloglock)|(databasechangelog))]]></table-exclusion-pattern>
      <config>
           <property name="nbRepeatTolerance">2</property>
           <property name="minTextColumnSize">2</property>
      </config>
   </linter>
    @Override
    public void configure(LinterConfig linterConfig) {
        nbRepeatTolerance = linterConfig.getConfig().getIntegerValue(NB_REPEAT_TOLERANCE_CONFIG, NB_REPEAT_TOLERANCE);
        minTextColumnSize = linterConfig.getConfig().getIntegerValue(MIN_TEXT_COLUMN_SIZE_CONFIG, MIN_TEXT_COLUMN_SIZE);
    }

If I comment the method configure the <table-exclusion-pattern> is taken account.

schemacrawler commented 8 years ago

You need to call super.configure(linterConfig); first.

mbarre commented 8 years ago

It works better like that ;) :+1:

Thanks.

schemacrawler commented 8 years ago

:-)