Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
fbcode: remove unused includes from .cpp files with no #if and #define
Browse files Browse the repository at this point in the history
Summary:
This is a first diff to remove the "easiest" unused includes in fbcode.

* For safety, we only touch .cpp files without #if and #define,
* We do not try to remove redundant systems headers (aka. "packing").

The diff was generated as follows:
```
foundation/scripts/ls-cpp-dirs | grep -v '^\(\.\.\|external/\|.*/external\)' | xargs ffmr -o /tmp/ffmr-diff-1 codegraph/scripts/ffmr/analyze_includes_no_headers_no_packing_skipping_ifdefs.sh

cat /tmp/ffmr-diff-1/*.diff | patch -p2
hg commit -m something
arc diff --prepare --nolint --nounit --less-context --excuse refactoring
```

Note: `grep -v` is just an optimization. The actual configuration is in these two files:
diffusion/FBS/browse/master/fbcode/codegraph/analysis/config.py
diffusion/FBS/browse/master/fbcode/codegraph/scripts/ffmr/analyze_includes_no_headers_no_packing_skipping_ifdefs.sh

See the task for more context, and the recent "safety" improvements on the tool.

depends on D4317825 for very few cases where `nolint` had to be manually added.

Reviewed By: igorsugak

Differential Revision: D4312617

fbshipit-source-id: ecc1f0addfd0651fa4770fcc43cd1314661a311a
  • Loading branch information
ma2bd authored and facebook-github-bot committed Dec 18, 2016
1 parent a50f1a4 commit 32e950a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion CounterStatistic.cpp
Expand Up @@ -12,7 +12,6 @@

#include "treadmill/Util.h"

#include <cmath>
#include <mutex>
#include <unordered_map>

Expand Down
2 changes: 0 additions & 2 deletions services/memcached/Treadmill.cpp
Expand Up @@ -8,8 +8,6 @@
*
*/

#include <gflags/gflags.h>

#include "treadmill/services/memcached/Connection.h"
#include "treadmill/services/memcached/Workload.h"

Expand Down
1 change: 0 additions & 1 deletion services/sleep/sleepserver/SleepClient.cpp
Expand Up @@ -8,7 +8,6 @@
*
*/

#include <unistd.h>
#include <gflags/gflags.h>

#include "treadmill/services/sleep/gen-cpp2/Sleep.h"
Expand Down

0 comments on commit 32e950a

Please sign in to comment.