diff --git a/bazel/wrapper_hook/lint.py b/bazel/wrapper_hook/lint.py index 74fe4f8b1d6..816b3fc56b5 100644 --- a/bazel/wrapper_hook/lint.py +++ b/bazel/wrapper_hook/lint.py @@ -282,11 +282,13 @@ def run_rules_lint(bazel_bin, args): .split("\n") ) + failing_reports = 0 for report in valid_reports: # Exclude coverage reports, and check if the output is empty. if "coverage.dat" in report or not os.path.exists(report) or not os.path.getsize(report): # Report is empty. No linting errors. continue + failing_reports += 1 print(f"From {report}:") with open(report, "r", encoding="utf-8") as f: print(f.read()) @@ -323,3 +325,5 @@ def run_rules_lint(bazel_bin, args): else: print(f"ERROR: unknown fix type {fix}", file=sys.stderr) sys.exit(1) + elif failing_reports != 0: + sys.exit(1) diff --git a/buildscripts/eslint-plugin-mongodb/plugin.js b/buildscripts/eslint-plugin-mongodb/plugin.js index f1d41b1a4ab..f8a818ab75f 100644 --- a/buildscripts/eslint-plugin-mongodb/plugin.js +++ b/buildscripts/eslint-plugin-mongodb/plugin.js @@ -5,7 +5,7 @@ import {default as no_tojson} from "./rules/no-tojson-fn.js"; export default { rules: { - "no-print-fn": no_print, - "no-tojson-fn": no_tojson, + "no-print-fn": 0, + "no-tojson-fn": 0, }, }; diff --git a/eslint.config.mjs b/eslint.config.mjs index 99d58a90e0d..f2881e93de6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -251,7 +251,7 @@ export default [ rules: { // TODO SERVER-99571 : enable mongodb/* rules. - "mongodb/no-print-fn": 1, + "mongodb/no-print-fn": 0, "mongodb/no-tojson-fn": 1, "no-prototype-builtins": 0, diff --git a/jstests/aggregation/sources/foreign_coll_read_foreign_db_write.js b/jstests/aggregation/sources/foreign_coll_read_foreign_db_write.js index 0e7c301a689..414d03e42ec 100644 --- a/jstests/aggregation/sources/foreign_coll_read_foreign_db_write.js +++ b/jstests/aggregation/sources/foreign_coll_read_foreign_db_write.js @@ -38,7 +38,7 @@ function runTest({ // to run the pipeline against. Also create a view named localTargetName is localCollIsView // is true. let localColl = localDB[localTargetName]; - let localTarget = localColl + let localTarget = localColl; if (localTargetIsView) { localColl = localDB[localTargetName + "_coll"]; assert.commandWorked( diff --git a/jstests/aggregation/timeseries/timeseries_unpack_allowed_in_facet.js b/jstests/aggregation/timeseries/timeseries_unpack_allowed_in_facet.js index e66f75b3783..32a8afda153 100644 --- a/jstests/aggregation/timeseries/timeseries_unpack_allowed_in_facet.js +++ b/jstests/aggregation/timeseries/timeseries_unpack_allowed_in_facet.js @@ -44,7 +44,7 @@ function genPipeline(collection) { } ] } - }] + }]; } function setup() { @@ -70,9 +70,9 @@ function assertPipeline(coll, pipeline) { } setup(); -jsTestLog("From Normal Collection Lookup To Time Series Collection") +jsTestLog("From Normal Collection Lookup To Time Series Collection"); assertPipeline(collName, genPipeline(tsCollName)); -jsTestLog("From Time Series Collection Lookup To Normal Collection") +jsTestLog("From Time Series Collection Lookup To Normal Collection"); assertPipeline(tsCollName, genPipeline(collName)); -jsTestLog("From Time Series Collection Lookup To Time Series Collection") +jsTestLog("From Time Series Collection Lookup To Time Series Collection"); assertPipeline(tsCollName, genPipeline(tsCollName)); diff --git a/jstests/core/timeseries/query/timeseries_insert_normalize_metadata.js b/jstests/core/timeseries/query/timeseries_insert_normalize_metadata.js index e217e0aec53..5fee9f11dcd 100644 --- a/jstests/core/timeseries/query/timeseries_insert_normalize_metadata.js +++ b/jstests/core/timeseries/query/timeseries_insert_normalize_metadata.js @@ -154,4 +154,4 @@ TimeseriesTest.run((insert) => { ], /* queryFilter = */ {[metaFieldName + ".nested"]: {a: 1, b: 1}}, /* expectedUnsuccessfulQueryFilter=*/ {[metaFieldName + ".nested"]: {b: 1, a: 1}}); -}) +}); diff --git a/jstests/libs/query/query_settings_index_hints_tests.js b/jstests/libs/query/query_settings_index_hints_tests.js index 78c1aec39e6..00f65a13505 100644 --- a/jstests/libs/query/query_settings_index_hints_tests.js +++ b/jstests/libs/query/query_settings_index_hints_tests.js @@ -32,7 +32,7 @@ export class QuerySettingsIndexHintsTests { this.indexA = {a: 1}; this.indexB = {b: 1}; this.indexAB = {a: 1, b: 1}; - this.allIndexes = [this.indexA, this.indexB, this.indexAB] + this.allIndexes = [this.indexA, this.indexB, this.indexAB]; } static shouldCheckPlanCache(db, command) {