Suppress lint in old files

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
main
Mark Isaacson 7 years ago committed by Facebook Github Bot
parent 9f7ccc8445
commit b8eb32f8cf
  1. 2
      buckifier/buckify_rocksdb.py
  2. 1
      buckifier/rocks_test_runner.sh
  3. 2
      build_tools/cont_integration.sh
  4. 1
      build_tools/dependencies.sh
  5. 1
      build_tools/dependencies_4.8.1.sh
  6. 5
      build_tools/make_package.sh
  7. 2
      coverage/parse_gcov_output.py
  8. 1
      db/log_reader.h
  9. 1
      hdfs/setup.sh
  10. 2
      java/jdb_bench.sh
  11. 1
      java/rocksjni/compaction_filter_factory.cc
  12. 1
      java/rocksjni/ingest_external_file_options.cc
  13. 1
      java/rocksjni/jnicallback.cc
  14. 1
      java/rocksjni/jnicallback.h
  15. 1
      java/rocksjni/rocks_callback_object.cc
  16. 1
      java/rocksjni/statisticsjni.cc
  17. 1
      java/rocksjni/statisticsjni.h
  18. 1
      table/cuckoo_table_builder_test.cc
  19. 1
      tools/auto_sanity_test.sh
  20. 1
      tools/benchmark.sh
  21. 1
      tools/benchmark_leveldb.sh
  22. 2
      tools/db_crashtest.py
  23. 4
      tools/ldb_test.py
  24. 1
      tools/regression_test.sh
  25. 1
      tools/rocksdb_dump_test.sh
  26. 2
      tools/write_stress_runner.py
  27. 1
      utilities/env_librados.cc
  28. 1
      utilities/simulator_cache/sim_cache.cc
  29. 1
      utilities/simulator_cache/sim_cache_test.cc
  30. 1
      utilities/ttl/ttl_test.cc

@ -36,7 +36,7 @@ def parse_src_mk(repo_path):
# get all .cc / .c files # get all .cc / .c files
def get_cc_files(repo_path): def get_cc_files(repo_path):
cc_files = [] 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):] root = root[(len(repo_path) + 1):]
if "java" in root: if "java" in root:
# Skip java # Skip java

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Create a tmp directory for the test to use # Create a tmp directory for the test to use
TEST_DIR=$(mktemp -d /dev/shm/fbcode_rocksdb_XXXXXXX) TEST_DIR=$(mktemp -d /dev/shm/fbcode_rocksdb_XXXXXXX)
# shellcheck disable=SC2068
TEST_TMPDIR="$TEST_DIR" $@ && rm -rf "$TEST_DIR" TEST_TMPDIR="$TEST_DIR" $@ && rm -rf "$TEST_DIR"

@ -13,10 +13,12 @@ error=0
function log { function log {
DATE=`date +%Y-%m-%d:%H:%M:%S` DATE=`date +%Y-%m-%d:%H:%M:%S`
# shellcheck disable=SC2068
echo $DATE $@ echo $DATE $@
} }
function log_err { function log_err {
# shellcheck disable=SC2145
log "ERROR: $@ Error code: $error." log "ERROR: $@ Error code: $error."
} }

@ -1,3 +1,4 @@
# shellcheck disable=SC2148
GCC_BASE=/mnt/gvfs/third-party2/gcc/8219ec1bcedf8ad9da05e121e193364de2cc4f61/5.x/centos6-native/c447969 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 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 LIBGCC_BASE=/mnt/gvfs/third-party2/libgcc/ba9be983c81de7299b59fe71950c664a84dcb5f8/5.x/gcc-5-glibc-2.23/339d858

@ -1,3 +1,4 @@
# shellcheck disable=SC2148
GCC_BASE=/mnt/gvfs/third-party2/gcc/cf7d14c625ce30bae1a4661c2319c5a283e4dd22/4.8.1/centos6-native/cc6c9dc 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 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 LIBGCC_BASE=/mnt/gvfs/third-party2/libgcc/d6e0a7da6faba45f5e5b1638f9edd7afc2f34e7d/4.8.1/gcc-4.8.1-glibc-2.17/8aac7fc

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

@ -72,7 +72,7 @@ def display_file_coverage(per_file_coverage, total_coverage):
header_template = \ header_template = \
"%" + str(max_file_name_length) + "s\t%s\t%s" "%" + str(max_file_name_length) + "s\t%s\t%s"
separator = "-" * (max_file_name_length + 10 + 20) 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 separator
# -- Print body # -- Print body

@ -54,6 +54,7 @@ class Reader {
// The Reader will start reading at the first record located at physical // The Reader will start reading at the first record located at physical
// position >= initial_offset within the file. // position >= initial_offset within the file.
Reader(std::shared_ptr<Logger> info_log, Reader(std::shared_ptr<Logger> info_log,
// @lint-ignore TXT2 T25377293 Grandfathered in
unique_ptr<SequentialFileReader>&& file, unique_ptr<SequentialFileReader>&& file,
Reporter* reporter, bool checksum, uint64_t initial_offset, Reporter* reporter, bool checksum, uint64_t initial_offset,
uint64_t log_num); uint64_t log_num);

@ -1,3 +1,4 @@
# shellcheck disable=SC2148
export USE_HDFS=1 export USE_HDFS=1
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$JAVA_HOME/jre/lib/amd64:/usr/lib/hadoop/lib/native export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$JAVA_HOME/jre/lib/amd64:/usr/lib/hadoop/lib/native

@ -1,3 +1,4 @@
# shellcheck disable=SC2148
PLATFORM=64 PLATFORM=64
if [ `getconf LONG_BIT` != "64" ] if [ `getconf LONG_BIT` != "64" ]
then then
@ -7,4 +8,5 @@ fi
ROCKS_JAR=`find target -name rocksdbjni*.jar` ROCKS_JAR=`find target -name rocksdbjni*.jar`
echo "Running benchmark in $PLATFORM-Bit mode." 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 $@ java -server -d$PLATFORM -XX:NewSize=4m -XX:+AggressiveOpts -Djava.library.path=target -cp "${ROCKS_JAR}:benchmark/target/classes" org.rocksdb.benchmark.DbBenchmark $@

@ -34,4 +34,5 @@ void Java_org_rocksdb_AbstractCompactionFilterFactory_disposeInternal(
auto* ptr_sptr_cff = auto* ptr_sptr_cff =
reinterpret_cast<std::shared_ptr<rocksdb::CompactionFilterFactoryJniCallback> *>(jhandle); reinterpret_cast<std::shared_ptr<rocksdb::CompactionFilterFactoryJniCallback> *>(jhandle);
delete ptr_sptr_cff; delete ptr_sptr_cff;
// @lint-ignore TXT4 T25377293 Grandfathered in
} }

@ -146,4 +146,5 @@ void Java_org_rocksdb_IngestExternalFileOptions_disposeInternal(
auto* options = auto* options =
reinterpret_cast<rocksdb::IngestExternalFileOptions*>(jhandle); reinterpret_cast<rocksdb::IngestExternalFileOptions*>(jhandle);
delete options; delete options;
// @lint-ignore TXT4 T25377293 Grandfathered in
} }

@ -49,4 +49,5 @@ JniCallback::~JniCallback() {
releaseJniEnv(attached_thread); releaseJniEnv(attached_thread);
} }
// @lint-ignore TXT4 T25377293 Grandfathered in
} // namespace rocksdb } // namespace rocksdb

@ -25,4 +25,5 @@ namespace rocksdb {
}; };
} }
// @lint-ignore TXT4 T25377293 Grandfathered in
#endif // JAVA_ROCKSJNI_JNICALLBACK_H_ #endif // JAVA_ROCKSJNI_JNICALLBACK_H_

@ -24,4 +24,5 @@ void Java_org_rocksdb_RocksCallbackObject_disposeInternal(
// 2) Comparator -> BaseComparatorJniCallback + JniCallback -> ComparatorJniCallback // 2) Comparator -> BaseComparatorJniCallback + JniCallback -> ComparatorJniCallback
// I think this is okay, as Comparator and JniCallback both have virtual destructors... // I think this is okay, as Comparator and JniCallback both have virtual destructors...
delete reinterpret_cast<rocksdb::JniCallback*>(handle); delete reinterpret_cast<rocksdb::JniCallback*>(handle);
// @lint-ignore TXT4 T25377293 Grandfathered in
} }

@ -30,4 +30,5 @@ namespace rocksdb {
return true; return true;
} }
// @lint-ignore TXT4 T25377293 Grandfathered in
}; };

@ -30,4 +30,5 @@ namespace rocksdb {
} // namespace rocksdb } // namespace rocksdb
// @lint-ignore TXT4 T25377293 Grandfathered in
#endif // JAVA_ROCKSJNI_STATISTICSJNI_H_ #endif // JAVA_ROCKSJNI_STATISTICSJNI_H_

@ -49,6 +49,7 @@ class CuckooBuilderTest : public testing::Test {
uint64_t read_file_size; uint64_t read_file_size;
ASSERT_OK(env_->GetFileSize(fname, &read_file_size)); ASSERT_OK(env_->GetFileSize(fname, &read_file_size));
// @lint-ignore TXT2 T25377293 Grandfathered in
Options options; Options options;
options.allow_mmap_reads = true; options.allow_mmap_reads = true;
ImmutableCFOptions ioptions(options); ImmutableCFOptions ioptions(options);

@ -1,3 +1,4 @@
# shellcheck disable=SC2148
TMP_DIR="${TMPDIR:-/tmp}/rocksdb-sanity-test" TMP_DIR="${TMPDIR:-/tmp}/rocksdb-sanity-test"
if [ "$#" -lt 2 ]; then if [ "$#" -lt 2 ]; then

@ -449,6 +449,7 @@ echo "===== Benchmark ====="
# Run!!! # Run!!!
IFS=',' read -a jobs <<< $1 IFS=',' read -a jobs <<< $1
# shellcheck disable=SC2068
for job in ${jobs[@]}; do for job in ${jobs[@]}; do
if [ $job != debug ]; then if [ $job != debug ]; then

@ -151,6 +151,7 @@ echo "===== Benchmark ====="
# Run!!! # Run!!!
IFS=',' read -a jobs <<< $1 IFS=',' read -a jobs <<< $1
# shellcheck disable=SC2068
for job in ${jobs[@]}; do for job in ${jobs[@]}; do
if [ $job != debug ]; then if [ $job != debug ]; then

@ -317,7 +317,7 @@ def whitebox_crash_main(args):
cmd = gen_cmd(dict(cmd_params.items() + additional_opts.items() cmd = gen_cmd(dict(cmd_params.items() + additional_opts.items()
+ {'db': dbname}.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, popen = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)

@ -229,7 +229,7 @@ class LDBTestCase(unittest.TestCase):
self.assertRunFAIL("get --ttl a3") self.assertRunFAIL("get --ttl a3")
self.assertRunOK("checkconsistency", "OK") self.assertRunOK("checkconsistency", "OK")
def testInvalidCmdLines(self): def testInvalidCmdLines(self): # noqa: F811 T25377293 Grandfathered in
print "Running testInvalidCmdLines..." print "Running testInvalidCmdLines..."
# db not specified # db not specified
self.assertRunFAILFull("put 0x6133 0x6233 --hex --create_if_missing") self.assertRunFAILFull("put 0x6133 0x6233 --hex --create_if_missing")
@ -516,7 +516,7 @@ class LDBTestCase(unittest.TestCase):
def testColumnFamilies(self): def testColumnFamilies(self):
print "Running testColumnFamilies..." 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_1 1 --create_if_missing", "OK")
self.assertRunOK("put cf1_2 2 --create_if_missing", "OK") self.assertRunOK("put cf1_2 2 --create_if_missing", "OK")
self.assertRunOK("put cf1_3 3 --try_load_options", "OK") self.assertRunOK("put cf1_3 3 --try_load_options", "OK")

@ -465,4 +465,5 @@ function cleanup_test_directory {
############################################################################ ############################################################################
# shellcheck disable=SC2068
main $@ main $@

@ -1,3 +1,4 @@
# shellcheck disable=SC2148
TESTDIR=`mktemp -d ${TMPDIR:-/tmp}/rocksdb-dump-test.XXXXX` TESTDIR=`mktemp -d ${TMPDIR:-/tmp}/rocksdb-dump-test.XXXXX`
DUMPFILE="tools/sample-dump.dmp" DUMPFILE="tools/sample-dump.dmp"

@ -21,7 +21,7 @@ def generate_runtimes(total_runtime):
def main(args): def main(args):
runtimes = generate_runtimes(int(args.runtime_sec)) 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 first_time = True
for runtime in runtimes: for runtime in runtimes:

@ -1485,4 +1485,5 @@ EnvLibrados* EnvLibrados::Default() {
default_pool_name); default_pool_name);
return &default_env; return &default_env;
} }
// @lint-ignore TXT4 T25377293 Grandfathered in
} }

@ -89,6 +89,7 @@ class CacheActivityLogger {
log_line += key.ToString(true); log_line += key.ToString(true);
log_line += " - "; log_line += " - ";
AppendNumberTo(&log_line, size); AppendNumberTo(&log_line, size);
// @lint-ignore TXT2 T25377293 Grandfathered in
log_line += "\n"; log_line += "\n";
// line format: "ADD - <KEY> - <KEY-SIZE>" // line format: "ADD - <KEY> - <KEY-SIZE>"

@ -193,6 +193,7 @@ TEST_F(SimCacheTest, SimCacheLogging) {
ASSERT_EQ(add_num, num_block_entries); ASSERT_EQ(add_num, num_block_entries);
// Log things again but stop logging automatically after reaching 512 bytes // Log things again but stop logging automatically after reaching 512 bytes
// @lint-ignore TXT2 T25377293 Grandfathered in
int max_size = 512; int max_size = 512;
ASSERT_OK(sim_cache->StartActivityLogging(log_file, env_, max_size)); ASSERT_OK(sim_cache->StartActivityLogging(log_file, env_, max_size));
for (int it = 0; it < 10; it++) { for (int it = 0; it < 10; it++) {

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

Loading…
Cancel
Save