Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Issue 3402010: Google codestyle prescribes sorting #include filenames within a section.... (Closed)

Created:
10 years, 3 months ago by Denis Lagno
Modified:
9 years, 6 months ago
CC:
chromium-reviews, ben+cc_chromium.org, nkostylev+cc_chromium.org, davemoore+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Google codestyle prescribes sorting #include filenames within a section. Do it fast with following shell script: export LC_ALL=C find chrome/browser/chromeos/ -name '*.h' -o -name '*.cc' \ | xargs grep -C1 '^#include' \ | awk -F: '$2 !~ "include" { prev=""; next } ($2 <= prev) { print $1 } { prev=$2 }' \ | uniq \ | xargs -n1 sh -c 'cat "$1" \ | awk "{ tag=((/^#include/) \"_\" (/</) \"_\" (/third.party/)); print tag \"\t\" \$0 }" \ | awk -vi=0 -F\\t "{ if (!/^1_0_/ || \$1 != prev) { ++i } } { printf \"%09d\t%s\n\",i,\$0; prev=\$1 }" \ | sort \ | sed "s/^[0-9]*\t[0-9]_[0-9]_[0-9]\t//" > "$1".fixed; mv -f "$1".fixed "$1"' xxx BUG=None TEST=Manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=59646

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -80 lines) Patch
M chrome/browser/chromeos/cros/burn_library.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/cros/burn_library.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/cros/cros_library.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/cros/cros_mock.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/cros/mock_mount_library.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/cros_settings_provider_user.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/dom_ui/imageburner_ui.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/dom_ui/system_settings_provider.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/frame/browser_view.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/frame/panel_controller.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/frame/panel_controller.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/gview_request_interceptor.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/input_method/candidate_window.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/account_screen_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/background_view.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/cookie_fetcher_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/existing_user_controller.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/language_switch_menu.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/login_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/login_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/network_screen.h View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/network_screen.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/network_screen_browsertest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/new_user_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/owner_key_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/owner_key_utils_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/owner_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/owner_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/rounded_rect_painter.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/screen_locker_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/screen_locker_tester.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/signed_settings_helper_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/signed_settings_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/user_image_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/user_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/wizard_accessibility_helper.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/wizard_controller.cc View 3 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/network_state_notifier_browsertest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/notifications/notification_panel.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/notifications/notification_panel.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/offline/offline_load_service.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/offline/offline_load_service.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/options/language_hangul_config_view.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/options/language_pinyin_config_view.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/options/system_page_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/panels/panel_scroller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/preferences.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/tab_closeable_state_watcher.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/update_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/usb_mount_observer.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/usb_mount_observer_browsertest.cc View 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/wm_ipc.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/wm_overview_fav_icon.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/wm_overview_snapshot.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Denis Lagno
please take a look
10 years, 3 months ago (2010-09-16 13:37:08 UTC) #1
Dmitry Polukhin
LGTM Thanks a lot for doing this! It would be good to add this check ...
10 years, 3 months ago (2010-09-16 13:51:44 UTC) #2
Denis Lagno
On 2010/09/16 13:51:44, Dmitry Polukhin wrote: > It would be good to add this check ...
10 years, 3 months ago (2010-09-16 15:48:12 UTC) #3
Nikita (slow)
10 years, 3 months ago (2010-09-16 15:50:52 UTC) #4
Great!

I'd say we should submit this scripttoo so that other parts of repository could
be cleaned up as well.
As the other thing (which is better) - run it for all Chromium repository (may
be split into parts) and enable presubmit check.

Powered by Google App Engine
This is Rietveld 408576698