Skip to content

Commit

Permalink
Suppress lint in old files
Browse files Browse the repository at this point in the history
Summary: Grandfather in super old lint issues to make a clean slate for moving forward that allows us to have stronger enforcement on new issues.

Reviewed By: yiwu-arbug

Differential Revision: D6821806

fbshipit-source-id: 22797d31ec58e9eb0255d3b66fedfcfcb0dc127c
  • Loading branch information
markisaa authored and facebook-github-bot committed Jan 29, 2018
1 parent 9f7ccc8 commit b8eb32f
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion buckifier/buckify_rocksdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_src_mk(repo_path):
# get all .cc / .c files
def get_cc_files(repo_path):
cc_files = []
for root, dirnames, filenames in os.walk(repo_path):
for root, dirnames, filenames in os.walk(repo_path): # noqa: B007 T25377293 Grandfathered in
root = root[(len(repo_path) + 1):]
if "java" in root:
# Skip java
Expand Down
1 change: 1 addition & 0 deletions buckifier/rocks_test_runner.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# Create a tmp directory for the test to use
TEST_DIR=$(mktemp -d /dev/shm/fbcode_rocksdb_XXXXXXX)
# shellcheck disable=SC2068
TEST_TMPDIR="$TEST_DIR" $@ && rm -rf "$TEST_DIR"
2 changes: 2 additions & 0 deletions build_tools/cont_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ error=0

function log {
DATE=`date +%Y-%m-%d:%H:%M:%S`
# shellcheck disable=SC2068
echo $DATE $@
}

function log_err {
# shellcheck disable=SC2145
log "ERROR: $@ Error code: $error."
}

Expand Down
1 change: 1 addition & 0 deletions build_tools/dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC2148
GCC_BASE=/mnt/gvfs/third-party2/gcc/8219ec1bcedf8ad9da05e121e193364de2cc4f61/5.x/centos6-native/c447969
CLANG_BASE=/mnt/gvfs/third-party2/llvm-fb/64d8d58e3d84f8bde7a029763d4f5baf39d0d5b9/stable/centos6-native/6aaf4de
LIBGCC_BASE=/mnt/gvfs/third-party2/libgcc/ba9be983c81de7299b59fe71950c664a84dcb5f8/5.x/gcc-5-glibc-2.23/339d858
Expand Down
1 change: 1 addition & 0 deletions build_tools/dependencies_4.8.1.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC2148
GCC_BASE=/mnt/gvfs/third-party2/gcc/cf7d14c625ce30bae1a4661c2319c5a283e4dd22/4.8.1/centos6-native/cc6c9dc
CLANG_BASE=/mnt/gvfs/third-party2/llvm-fb/8598c375b0e94e1448182eb3df034704144a838d/stable/centos6-native/3f16ddd
LIBGCC_BASE=/mnt/gvfs/third-party2/libgcc/d6e0a7da6faba45f5e5b1638f9edd7afc2f34e7d/4.8.1/gcc-4.8.1-glibc-2.17/8aac7fc
Expand Down
5 changes: 5 additions & 0 deletions build_tools/make_package.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC1113
#/usr/bin/env bash

set -e
Expand Down Expand Up @@ -28,12 +29,14 @@ function package() {
if dpkg --get-selections | grep --quiet $1; then
log "$1 is already installed. skipping."
else
# shellcheck disable=SC2068
apt-get install $@ -y
fi
elif [[ $OS = "centos" ]]; then
if rpm -qa | grep --quiet $1; then
log "$1 is already installed. skipping."
else
# shellcheck disable=SC2068
yum install $@ -y
fi
fi
Expand All @@ -52,6 +55,7 @@ function gem_install() {
if gem list | grep --quiet $1; then
log "$1 is already installed. skipping."
else
# shellcheck disable=SC2068
gem install $@
fi
}
Expand Down Expand Up @@ -125,4 +129,5 @@ function main() {
include $LIB_DIR
}

# shellcheck disable=SC2068
main $@
2 changes: 1 addition & 1 deletion coverage/parse_gcov_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def display_file_coverage(per_file_coverage, total_coverage):
header_template = \
"%" + str(max_file_name_length) + "s\t%s\t%s"
separator = "-" * (max_file_name_length + 10 + 20)
print header_template % ("Filename", "Coverage", "Lines")
print header_template % ("Filename", "Coverage", "Lines") # noqa: E999 T25377293 Grandfathered in
print separator

# -- Print body
Expand Down
1 change: 1 addition & 0 deletions db/log_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Reader {
// The Reader will start reading at the first record located at physical
// position >= initial_offset within the file.
Reader(std::shared_ptr<Logger> info_log,
// @lint-ignore TXT2 T25377293 Grandfathered in
unique_ptr<SequentialFileReader>&& file,
Reporter* reporter, bool checksum, uint64_t initial_offset,
uint64_t log_num);
Expand Down
1 change: 1 addition & 0 deletions hdfs/setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC2148
export USE_HDFS=1
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$JAVA_HOME/jre/lib/amd64:/usr/lib/hadoop/lib/native

Expand Down
2 changes: 2 additions & 0 deletions java/jdb_bench.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC2148
PLATFORM=64
if [ `getconf LONG_BIT` != "64" ]
then
Expand All @@ -7,4 +8,5 @@ fi
ROCKS_JAR=`find target -name rocksdbjni*.jar`

echo "Running benchmark in $PLATFORM-Bit mode."
# shellcheck disable=SC2068
java -server -d$PLATFORM -XX:NewSize=4m -XX:+AggressiveOpts -Djava.library.path=target -cp "${ROCKS_JAR}:benchmark/target/classes" org.rocksdb.benchmark.DbBenchmark $@
1 change: 1 addition & 0 deletions java/rocksjni/compaction_filter_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ void Java_org_rocksdb_AbstractCompactionFilterFactory_disposeInternal(
auto* ptr_sptr_cff =
reinterpret_cast<std::shared_ptr<rocksdb::CompactionFilterFactoryJniCallback> *>(jhandle);
delete ptr_sptr_cff;
// @lint-ignore TXT4 T25377293 Grandfathered in
}
1 change: 1 addition & 0 deletions java/rocksjni/ingest_external_file_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ void Java_org_rocksdb_IngestExternalFileOptions_disposeInternal(
auto* options =
reinterpret_cast<rocksdb::IngestExternalFileOptions*>(jhandle);
delete options;
// @lint-ignore TXT4 T25377293 Grandfathered in
}
1 change: 1 addition & 0 deletions java/rocksjni/jnicallback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ JniCallback::~JniCallback() {

releaseJniEnv(attached_thread);
}
// @lint-ignore TXT4 T25377293 Grandfathered in
} // namespace rocksdb
1 change: 1 addition & 0 deletions java/rocksjni/jnicallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ namespace rocksdb {
};
}

// @lint-ignore TXT4 T25377293 Grandfathered in
#endif // JAVA_ROCKSJNI_JNICALLBACK_H_
1 change: 1 addition & 0 deletions java/rocksjni/rocks_callback_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ void Java_org_rocksdb_RocksCallbackObject_disposeInternal(
// 2) Comparator -> BaseComparatorJniCallback + JniCallback -> ComparatorJniCallback
// I think this is okay, as Comparator and JniCallback both have virtual destructors...
delete reinterpret_cast<rocksdb::JniCallback*>(handle);
// @lint-ignore TXT4 T25377293 Grandfathered in
}
1 change: 1 addition & 0 deletions java/rocksjni/statisticsjni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ namespace rocksdb {

return true;
}
// @lint-ignore TXT4 T25377293 Grandfathered in
};
1 change: 1 addition & 0 deletions java/rocksjni/statisticsjni.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ namespace rocksdb {

} // namespace rocksdb

// @lint-ignore TXT4 T25377293 Grandfathered in
#endif // JAVA_ROCKSJNI_STATISTICSJNI_H_
1 change: 1 addition & 0 deletions table/cuckoo_table_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class CuckooBuilderTest : public testing::Test {
uint64_t read_file_size;
ASSERT_OK(env_->GetFileSize(fname, &read_file_size));

// @lint-ignore TXT2 T25377293 Grandfathered in
Options options;
options.allow_mmap_reads = true;
ImmutableCFOptions ioptions(options);
Expand Down
1 change: 1 addition & 0 deletions tools/auto_sanity_test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC2148
TMP_DIR="${TMPDIR:-/tmp}/rocksdb-sanity-test"

if [ "$#" -lt 2 ]; then
Expand Down
1 change: 1 addition & 0 deletions tools/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ echo "===== Benchmark ====="

# Run!!!
IFS=',' read -a jobs <<< $1
# shellcheck disable=SC2068
for job in ${jobs[@]}; do

if [ $job != debug ]; then
Expand Down
1 change: 1 addition & 0 deletions tools/benchmark_leveldb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ echo "===== Benchmark ====="

# Run!!!
IFS=',' read -a jobs <<< $1
# shellcheck disable=SC2068
for job in ${jobs[@]}; do

if [ $job != debug ]; then
Expand Down
2 changes: 1 addition & 1 deletion tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def whitebox_crash_main(args):
cmd = gen_cmd(dict(cmd_params.items() + additional_opts.items()
+ {'db': dbname}.items()))

print "Running:" + ' '.join(cmd) + "\n"
print "Running:" + ' '.join(cmd) + "\n" # noqa: E999 T25377293 Grandfathered in

popen = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
Expand Down
4 changes: 2 additions & 2 deletions tools/ldb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def testTtlPutGet(self):
self.assertRunFAIL("get --ttl a3")
self.assertRunOK("checkconsistency", "OK")

def testInvalidCmdLines(self):
def testInvalidCmdLines(self): # noqa: F811 T25377293 Grandfathered in
print "Running testInvalidCmdLines..."
# db not specified
self.assertRunFAILFull("put 0x6133 0x6233 --hex --create_if_missing")
Expand Down Expand Up @@ -516,7 +516,7 @@ def testListColumnFamilies(self):

def testColumnFamilies(self):
print "Running testColumnFamilies..."
dbPath = os.path.join(self.TMP_DIR, self.DB_NAME)
dbPath = os.path.join(self.TMP_DIR, self.DB_NAME) # noqa: F841 T25377293 Grandfathered in
self.assertRunOK("put cf1_1 1 --create_if_missing", "OK")
self.assertRunOK("put cf1_2 2 --create_if_missing", "OK")
self.assertRunOK("put cf1_3 3 --try_load_options", "OK")
Expand Down
1 change: 1 addition & 0 deletions tools/regression_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,5 @@ function cleanup_test_directory {

############################################################################

# shellcheck disable=SC2068
main $@
1 change: 1 addition & 0 deletions tools/rocksdb_dump_test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=SC2148
TESTDIR=`mktemp -d ${TMPDIR:-/tmp}/rocksdb-dump-test.XXXXX`
DUMPFILE="tools/sample-dump.dmp"

Expand Down
2 changes: 1 addition & 1 deletion tools/write_stress_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def generate_runtimes(total_runtime):

def main(args):
runtimes = generate_runtimes(int(args.runtime_sec))
print "Going to execute write stress for " + str(runtimes)
print "Going to execute write stress for " + str(runtimes) # noqa: E999 T25377293 Grandfathered in
first_time = True

for runtime in runtimes:
Expand Down
1 change: 1 addition & 0 deletions utilities/env_librados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1485,4 +1485,5 @@ EnvLibrados* EnvLibrados::Default() {
default_pool_name);
return &default_env;
}
// @lint-ignore TXT4 T25377293 Grandfathered in
}
1 change: 1 addition & 0 deletions utilities/simulator_cache/sim_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class CacheActivityLogger {
log_line += key.ToString(true);
log_line += " - ";
AppendNumberTo(&log_line, size);
// @lint-ignore TXT2 T25377293 Grandfathered in
log_line += "\n";

// line format: "ADD - <KEY> - <KEY-SIZE>"
Expand Down
1 change: 1 addition & 0 deletions utilities/simulator_cache/sim_cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ TEST_F(SimCacheTest, SimCacheLogging) {
ASSERT_EQ(add_num, num_block_entries);

// Log things again but stop logging automatically after reaching 512 bytes
// @lint-ignore TXT2 T25377293 Grandfathered in
int max_size = 512;
ASSERT_OK(sim_cache->StartActivityLogging(log_file, env_, max_size));
for (int it = 0; it < 10; it++) {
Expand Down
1 change: 1 addition & 0 deletions utilities/ttl/ttl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ TEST_F(TtlTest, ChangeTtlOnOpenDb) {

OpenTtl(1); // T=0:Open the db with ttl = 2
SetTtl(3);
// @lint-ignore TXT2 T25377293 Grandfathered in
PutValues(0, kSampleSize_); // T=0:Insert Set1. Delete at t=2
SleepCompactCheck(2, 0, kSampleSize_, true); // T=2:Set1 should be there
CloseTtl();
Expand Down

0 comments on commit b8eb32f

Please sign in to comment.