Coder Social home page Coder Social logo

git-cmake-format's People

Contributors

frasercrmck avatar gflegar avatar jbreitbart avatar kbenzie avatar tristan0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

git-cmake-format's Issues

Set clang-format style from CMakeLists.txt

Not all users will require the use of a .clang-format file as they will be using one of the built in styles.
Add a CMake option to allow setting this value, default to file.

git commit --amend fails

When trying to amend a commit, I see the following error:

Traceback (most recent call last):
  File "/Users/gegles/Workspaces/fasp.io/cmake/git-cmake-format/git-cmake-format.py", line 114, in <module>
    if not isFormattable(FileName):
  File "/Users/gegles/Workspaces/fasp.io/cmake/git-cmake-format/git-cmake-format.py", line 43, in isFormattable
    if '' != Dir and '' != os.path.commonprefix([os.path.relpath(File), os.path.relpath(Dir)]):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 428, in relpath
    raise ValueError("no path specified")
ValueError: no path specified

Probably need to support the script running with no actual files changed..

Only reject staged unformatted files

Right now git-cmake-format rejects commits where any tracked C/C++ file is improperly formatted. Here's an example:

> git status

Changes not staged for commit:
    modified:     foo.cpp
    modified:     bar.cpp

> git add foo.cpp
> git commit -m "Updated foo"

'bar.cpp' must be formatted, run the cmake target 'format'

I think it would be an easier work flow if I could still commit foo.cpp even if bar.cpp wasn't formatted.

Glancing at it, you could try adding --cached to the flags passed to git in git-cmake-format.py/getEditedFiles()

Exclude some files?

Is it possible to exclude some files from the format checking / reformating? I typically use a vendor directory, which includes sources coming from 3rd parties, which should stay the way I received them.

What is the best way to implement such a feature? Do you have an idea?

Name confusion

There now exists a program called cmake-format for auto-formatting CMake listfiles (written in Python: pip install cmake-format and then run cmake-format from the command line). The name of git-cmake-format is a bit confusing under the circumstances since AFAICT it doesn't use cmake-format :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.