f981cdb28308ceeb88a91fa7ea81fe86a8d96ed6
chmalee
  Mon Oct 3 12:52:00 2022 -0700
Add a hubCheck test for the autoScale setting for bigWigs, refs #30057

diff --git src/hg/utils/hubCheck/hubCheck.c src/hg/utils/hubCheck/hubCheck.c
index a912c15..1d524b5 100644
--- src/hg/utils/hubCheck/hubCheck.c
+++ src/hg/utils/hubCheck/hubCheck.c
@@ -874,30 +874,41 @@
     boolean foundTypeError = checkTypeLine(genome, tdb, errors, options);
 
     // No point in checking the data file if the type setting is incorrect,
     // since hubCheckBigDataUrl will error out early with a less clear message
     // if the type line is messed up. This has the added benefit of providing
     // consistent messaging on command line interface vs web interface
     if (!foundTypeError && options->checkFiles)
         hubCheckBigDataUrl(hub, genome, tdb);
 
     if (!sameString(tdb->track, "cytoBandIdeo"))
         {
         trackHubAddDescription(genome->trackDbFile, tdb);
         if (!tdb->html)
             warn("warning: missing description page for track: '%s'", tdb->track);
         }
+
+    if (!trackIsContainer && sameString(trackDbRequiredSetting(tdb, "type"), "bigWig"))
+        {
+        char *autoScaleSetting = trackDbLocalSetting(tdb, "autoScale");
+        if (autoScaleSetting && !sameString(autoScaleSetting, "off") && !sameString(autoScaleSetting, "on"))
+            {
+            errAbort("track \"%s\" has value \"%s\" for autoScale setting, "
+                    "valid autoScale values for bigWig tracks are \"off\" or \"on\" only",
+                    trackHubSkipHubName(tdb->track), autoScaleSetting);
+            }
+        }
     }
 errCatchEnd(errCatch);
 if (errCatch->gotError || errCatch->gotWarning)
     {
     retVal = 1;
     trackDbErr(errors, errCatch->message->string, genome, tdb, options->htmlOut);
     if (errCatch->gotError)
         trackDbErrorCount += 1;
     }
 errCatchFree(&errCatch);
 
 if (options->htmlOut)
     {
     if (trackIsContainer)
         {