summaryrefslogtreecommitdiff
path: root/tools/clang-format/clang-format-diff.py
Commit message (Collapse)AuthorAge
* clang-format: Add clang-format-diff usage examples for SVN.Daniel Jasper2014-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208766 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Enable formatting for .proto and .protodevel files.Daniel Jasper2014-01-21
| | | | | | Support for protocol buffer files seems complete enough. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199750 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix usage description of clang-format-diff.py.Daniel Jasper2013-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197668 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format-diff.py: fix -regex/-iregex matchingAlp Toker2013-12-18
| | | | | | | | | | While debating the finer points of file extension matching, we somehow missed the bigger problem that the current code will match anything starting with the default or user-specified pattern (e.g. lit.site.cfg.in). Fix this by doing what find(1) does, implicitly wrapping the pattern with ^$. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197608 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format-diff.py: add the OpenCL file extensionAlp Toker2013-12-18
| | | | | | It's handled correctly as a C-family language. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197542 91177308-0d34-0410-b5e6-96231b3b80d8
* Added -iregex for case-insensitive regex to filter file names.Alexander Kornienko2013-12-16
| | | | | | | | | | | | | | | | | Summary: -regex and -iregex both mimic options of the find utility. Made the default list of extensions case-insensitive, so that it's not only C and CPP extensions are accepted in upper case. Reviewers: djasper Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2415 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197378 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format-diff.py: Support -regex filter and more filename extensionsAlp Toker2013-12-10
| | | | | | | | | | | | | Add support for more filename extensions based on the list in the clang plus JavaScript. Also adds a -regex option so users can override defaults if they have unusual file extensions or want to format everything in the diff. Keeping with tradition the flag is modelled on Unix conventions, this time matching the semantics of find(1). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196917 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format-diff.py: pass through errors to stderr, not stdoutAlp Toker2013-12-05
| | | | | | | Also use write() for unified diff output to avoid further processing by the print function (e.g. trailing newline). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196484 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format-diff.py: Fix 'beintroduced' in help outputAlp Toker2013-12-04
| | | | | | Also update docs to reflect recently changed -i inplace edit behaviour. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196336 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed clang-format-diff.py to output diff by default. Added -i option to ↵Alexander Kornienko2013-10-11
| | | | | | | | | | | | | | | | | | | | | | apply changes to files instead. Summary: "svn diff|clang-format-diff.py" will just output the diff. Now it's possible to use: svn diff|clang-format-diff.py|patch -p0 as an equivalent to: svn diff|clang-format-diff.py -i ;) Reviewers: djasper Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1840 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192505 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Don't exit with failure on empty files.Daniel Jasper2013-10-08
| | | | | | | | | | Also let clang-format-diff.py detect errors based on clang-format's return code. Otherwise messages like "Can't find usable .clang-format, falling back to LLVM style" can make it fail, which might be undesired. Patch by Alp Toker. Thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192184 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix clang-format-diff.py according to diff specification.Daniel Jasper2013-10-02
| | | | | | | | | | | | | | | | | | | | | Patch by Alp Toker. Many thanks! Original descriptions: clang-format-diff incorrectly modifies unchanged lines due to an error in diff parsing. The unified diff format has a default line change count of 1, and 0 may be specified to indicate that no lines have been added. This patch updates the parser to accurately reflect the diff specification. This also has the benefit of stabilising the operation so it will produce the same output when run multiple times on the same changeset, which was previously not the case. No tests added because this script is not currently tested (though we should look into that!) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191820 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang-format-diff.py to accept -style again.Daniel Jasper2013-09-21
| | | | | | Copy and paste error in r190935.. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191137 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify clang-format-diff.py using new clang-format options.Daniel Jasper2013-09-18
| | | | | | clang-format's -lines parameter makes this significantly easier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190935 91177308-0d34-0410-b5e6-96231b3b80d8
* Added WebKit style to the BasedOnStyle handling and to the relevant help ↵Alexander Kornienko2013-09-02
| | | | | | messages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189765 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix default value of clang-format-diff's -p option.Daniel Jasper2013-05-30
| | | | | | | This way, it has the same default as 'patch' and also the example in the code makes more sense as it is explicitly setting -p 1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182923 91177308-0d34-0410-b5e6-96231b3b80d8
* Small improvements to clang-format documentation and integrationDaniel Jasper2013-04-17
| | | | | | scripts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179676 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang-format-diff.py script.Daniel Jasper2013-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179377 91177308-0d34-0410-b5e6-96231b3b80d8
* Improvements to clang-format integrations.Daniel Jasper2013-04-09
| | | | | | | | This adds an emacs editor integration (thanks to Ami Fischman). Also pulls out the style into a variable for the vi integration and just uses clang-formats defaults style in clang-format-diff.py. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179098 91177308-0d34-0410-b5e6-96231b3b80d8
* Add clang-format binary to cfe.Daniel Jasper2013-03-20
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177506 91177308-0d34-0410-b5e6-96231b3b80d8