Skip to content

Commit 2db3301

Browse files
committed
Make Meta Internal Linter happy (facebook#14074)
Summary: Linter complains like this ``` void foo(Arg parameter_name) {} void bar() { Arg a; foo(/*some_other_name=*/ a); // Wrong! Comment/parameter name mismatch foo(/*parameter_name=*/ a); // This is OK; the names match. } ``` ``` Argument name in comment (`read_only`) does not match parameter name (`unchanging`). ``` This used to be warning, but now treated as an error :( Fixing a few other linter warnings before they become errors in the future. Pull Request resolved: facebook#14074 Test Plan: CI Reviewed By: archang19 Differential Revision: D85370353 Pulled By: jaykorean fbshipit-source-id: 20e96aad740d516a29c0424282674e655f99c0a2
1 parent 5202d73 commit 2db3301

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

db/compaction/compaction_job_test.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class CompactionJobTestBase : public testing::Test {
216216
/*block_cache_tracer=*/nullptr,
217217
/*io_tracer=*/nullptr, /*db_id=*/"", /*db_session_id=*/"",
218218
/*daily_offpeak_time_utc=*/"",
219-
/*error_handler=*/nullptr, /*read_only=*/false)),
219+
/*error_handler=*/nullptr, /*unchanging=*/false)),
220220
shutting_down_(false),
221221
mock_table_factory_(new mock::MockTableFactory()),
222222
error_handler_(nullptr, db_options_, &mutex_),
@@ -552,7 +552,7 @@ class CompactionJobTestBase : public testing::Test {
552552
/*block_cache_tracer=*/nullptr, /*io_tracer=*/nullptr,
553553
test::kUnitTestDbId, /*db_session_id=*/"",
554554
/*daily_offpeak_time_utc=*/"",
555-
/*error_handler=*/nullptr, /*read_only=*/false));
555+
/*error_handler=*/nullptr, /*unchanging=*/false));
556556
compaction_job_stats_.Reset();
557557

558558
VersionEdit new_db;
@@ -2420,7 +2420,7 @@ class ResumableCompactionJobTest : public CompactionJobTestBase {
24202420

24212421
protected:
24222422
static constexpr const char* kCancelBeforeThisKey = "cancel_before_this_key";
2423-
std::string progress_dir_ = "";
2423+
std::string progress_dir_;
24242424
bool enable_cancel_ = false;
24252425
std::atomic<int> stop_count_{0};
24262426
std::atomic<bool> cancel_{false};
@@ -2580,7 +2580,9 @@ class ResumableCompactionJobTest : public CompactionJobTestBase {
25802580

25812581
while (reader.ReadRecord(&slice, &record)) {
25822582
VersionEdit edit;
2583-
if (!edit.DecodeFrom(slice).ok()) continue;
2583+
if (!edit.DecodeFrom(slice).ok()) {
2584+
continue;
2585+
}
25842586
builder.ProcessVersionEdit(edit);
25852587
}
25862588

tools/ldb_cmd.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ void DumpManifestFile(Options options, std::string file, bool verbose, bool hex,
16141614
/*block_cache_tracer=*/nullptr, /*io_tracer=*/nullptr,
16151615
/*db_id=*/"", /*db_session_id=*/"",
16161616
options.daily_offpeak_time_utc,
1617-
/*error_handler=*/nullptr, /*read_only=*/true);
1617+
/*error_handler=*/nullptr, /*unchanging=*/true);
16181618
Status s = versions.DumpManifest(options, file, verbose, hex, json, cf_descs);
16191619
if (!s.ok()) {
16201620
fprintf(stderr, "Error in processing file %s %s\n", file.c_str(),
@@ -1809,7 +1809,7 @@ Status GetLiveFilesChecksumInfoFromVersionSet(Options options,
18091809
/*block_cache_tracer=*/nullptr, /*io_tracer=*/nullptr,
18101810
/*db_id=*/"", /*db_session_id=*/"",
18111811
options.daily_offpeak_time_utc,
1812-
/*error_handler=*/nullptr, /*read_only=*/true);
1812+
/*error_handler=*/nullptr, /*unchanging=*/true);
18131813
std::vector<std::string> cf_name_list;
18141814
s = versions.ListColumnFamilies(&cf_name_list, db_path,
18151815
immutable_db_options.fs.get());

0 commit comments

Comments
 (0)