Changeset 15682 in josm


Ignore:
Timestamp:
2020-01-11T17:04:04+01:00 (3 months ago)
Author:
Don-vip
Message:

see #18455 - don't perform INFO level tests in TagChecker if not enabled

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/Test.java

    r15640 r15682  
    2323import org.openstreetmap.josm.data.osm.search.SearchCompiler.NotOutsideDataSourceArea;
    2424import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
     25import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
    2526import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    2627import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    141142        public void visit(Relation r) {
    142143            check(r);
     144        }
     145
     146        protected final boolean includeOtherSeverityChecks() {
     147            return isBeforeUpload ? ValidatorPrefHelper.PREF_OTHER_UPLOAD.get() : ValidatorPrefHelper.PREF_OTHER.get();
    143148        }
    144149    }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r15640 r15682  
    10051005        indexData = null;
    10061006    }
    1007 
    1008     private boolean includeOtherSeverityChecks() {
    1009         return isBeforeUpload ? ValidatorPrefHelper.PREF_OTHER_UPLOAD.get() : ValidatorPrefHelper.PREF_OTHER.get();
    1010     }
    1011 
    10121007}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r15667 r15682  
    144144
    145145    private static final int MAX_LEVENSHTEIN_DISTANCE = 2;
     146
     147    protected boolean includeOtherSeverity;
    146148
    147149    protected boolean checkKeys;
     
    694696            withErrors.put(p, errTypeSpace);
    695697        }
    696         if (!value.equals(Entities.unescape(value)) && !withErrors.contains(p, "HTML")) {
     698        if (includeOtherSeverity && !value.equals(Entities.unescape(value)) && !withErrors.contains(p, "HTML")) {
    697699            errors.add(TestError.builder(this, Severity.OTHER, INVALID_HTML)
    698700                    .message(tr("Property values contain HTML entity"), s, key)
     
    781783            }
    782784            withErrors.put(p, "WPK");
    783         } else {
     785        } else if (includeOtherSeverity) {
    784786            errors.add(TestError.builder(this, Severity.OTHER, INVALID_KEY)
    785787                    .message(tr("Presets do not contain property key"), marktr("Key ''{0}'' not in presets."), key)
     
    867869                    .build());
    868870            withErrors.put(p, "WPV");
    869         } else {
     871        } else if (includeOtherSeverity) {
    870872            // unknown preset value
    871873            errors.add(TestError.builder(this, Severity.OTHER, INVALID_VALUE)
     
    903905    public void startTest(ProgressMonitor monitor) {
    904906        super.startTest(monitor);
     907        includeOtherSeverity = includeOtherSeverityChecks();
    905908        checkKeys = Config.getPref().getBoolean(PREF_CHECK_KEYS, true);
    906909        if (isBeforeUpload) {
     
    918921        }
    919922
    920         checkFixmes = Config.getPref().getBoolean(PREF_CHECK_FIXMES, true);
     923        checkFixmes = includeOtherSeverity && Config.getPref().getBoolean(PREF_CHECK_FIXMES, true);
    921924        if (isBeforeUpload) {
    922925            checkFixmes = checkFixmes && Config.getPref().getBoolean(PREF_CHECK_FIXMES_BEFORE_UPLOAD, true);
    923926        }
    924927
    925         checkPresetsTypes = Config.getPref().getBoolean(PREF_CHECK_PRESETS_TYPES, true);
     928        checkPresetsTypes = includeOtherSeverity && Config.getPref().getBoolean(PREF_CHECK_PRESETS_TYPES, true);
    926929        if (isBeforeUpload) {
    927930            checkPresetsTypes = checkPresetsTypes && Config.getPref().getBoolean(PREF_CHECK_PRESETS_TYPES_BEFORE_UPLOAD, true);
Note: See TracChangeset for help on using the changeset viewer.