Skip to content
Snippets Groups Projects
  1. May 03, 2016
    • Brad King's avatar
      Source: Sort includes the way clang-format would · 54f71cd7
      Brad King authored
      Re-apply the approach from commit e1c77472 (Format include directive
      blocks and ordering with clang-format, 2016-04-29) but this time be
      more careful about exclusion of parser generator sources:
      
          $ git ls-files -z -- \
              '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
            egrep -z -v '^Source/cmCommandArgumentLexer\.' |
            egrep -z -v '^Source/cmCommandArgumentParser\.' |
            egrep -z -v '^Source/cmDependsJavaLexer\.' |
            egrep -z -v '^Source/cmDependsJavaParser\.' |
            egrep -z -v '^Source/cmExprLexer\.' |
            egrep -z -v '^Source/cmExprParser\.' |
            egrep -z -v '^Source/cmFortranLexer\.' |
            egrep -z -v '^Source/cmFortranParser\.' |
            egrep -z -v '^Source/cmListFileLexer\.' |
            egrep -z -v '^Source/cm_sha2' |
            egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
            egrep -z -v '^Utilities/(KW|cm).*/' |
            egrep -z -v '^Tests/Module/GenerateExportHeader' |
            egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
            xargs -0 clang-format -i
      
      Also drop use of custom sorting for `sys/types.h`.
      54f71cd7
    • Brad King's avatar
      Source: Sort includes of sys/types.h as clang-format would · 7b6ffa59
      Brad King authored
      When this header is included in blocks where order does not matter, just
      place it in lexicographic order as clang-format would by default.
      7b6ffa59
    • Brad King's avatar
      Source: Stabilize include order of sys/types.h before sys/stat.h · be14fe48
      Brad King authored
      Include the two headers in an isolated block with a comment separating
      them so that tools that re-order includes do not re-order these.
      be14fe48
    • Brad King's avatar
    • Brad King's avatar
      Tests: Fix Plugin test include order · a20d7d48
      Brad King authored
      Fix the order accidentally broken by commit e1c77472 (Format include
      directive blocks and ordering with clang-format, 2016-04-29).  Include
      the KWSys header first in its own block so that it is not moved by tools
      that re-order includes.  It must be included first to define large file
      support macros consistently.
      a20d7d48
  2. Apr 29, 2016
    • Brad King's avatar
      Format include directive blocks and ordering with clang-format · e1c77472
      Brad King authored
      
      Sort include directives within each block (separated by a blank line) in
      lexicographic order (except to prioritize `sys/types.h` first).  First
      run `clang-format` with the config file:
      
          ---
          SortIncludes: false
          ...
      
      Commit the result temporarily.  Then run `clang-format` again with:
      
          ---
          SortIncludes: true
          IncludeCategories:
            - Regex:    'sys/types.h'
              Priority: -1
          ...
      
      Commit the result temporarily.  Start a new branch and cherry-pick the
      second commit.  Manually resolve conflicts to preserve indentation of
      re-ordered includes.  This cleans up the include ordering without
      changing any other style.
      
      Use the following command to run `clang-format`:
      
          $ git ls-files -z -- \
              '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
            egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
            egrep -z -v '^Source/cm_sha2' |
            egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
            egrep -z -v '^Utilities/(KW|cm).*/' |
            egrep -z -v '^Tests/Module/GenerateExportHeader' |
            egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
            xargs -0 clang-format -i
      
      This selects source files that do not come from a third-party.
      
      Inspired-by: default avatarDaniel Pfeifer <daniel@pfeifer-mail.de>
      e1c77472
    • Brad King's avatar
      Source: Stabilize include order · 180538c7
      Brad King authored
      Each source file has a logical first include file.  Include it in an
      isolated block so that tools that sort includes do not move them.
      180538c7
    • Brad King's avatar
      Utilities/Release: Stabilize include order in WiX custom action · 0e7bca92
      Brad King authored
      In `detect_nsis_overwrite.cpp` we include windows.h first, and we must
      preserve that.  Place the include in an isolated block so that tools
      that sort includes do not move it.
      0e7bca92
    • Brad King's avatar
      Tests: Stabilize include order in MFC, VSXaml, and VSWinStorePhone · eb817be0
      Brad King authored
      These tests use a precompiled header that must be included first.
      Include the header in an isolated block so that tools that sort
      includes do not move it.
      eb817be0
    • Daniel Pfeifer's avatar
      Tests: Stabilize include order in StringFileTest · eda313b4
      Daniel Pfeifer authored and Brad King's avatar Brad King committed
      This test generates a header file which is not self-contained.
      Include it in a separate block of includes so that tools that
      sort includes do not move it.
      eda313b4
    • Daniel Pfeifer's avatar
      CursesDialog: add missing cmState include · 7110b754
      Daniel Pfeifer authored and Brad King's avatar Brad King committed
      7110b754
    • Brad King's avatar
      Modules: Remove unused CMakeTestWatcomVersion.c file · d7a5f255
      Brad King authored
      This file has not been used since commit v2.8.10~218^2~7^2 (Watcom:
      Simplify compiler version detection, 2012-08-13).
      d7a5f255
  3. Apr 28, 2016
  4. Apr 27, 2016
  5. Apr 26, 2016
  6. Apr 25, 2016
  7. Apr 24, 2016
  8. Apr 23, 2016
Loading