Code Monkey home page Code Monkey logo

pre-commit-hooks's People

Contributors

joro75 avatar

Watchers

 avatar

pre-commit-hooks's Issues

A file that is included in the project as 'Copy only', requires that a build is done

I have a C++ project that also includes another data file (or a related .py script file). It is only included in the project for easy access, and to ensure that it is copied to the output directory (which is common for unittest projects).

If that related file is updated, it can be newer than the compiled .DLL/.EXE. The 'check_successful_c_msbuild' than requires that a new build of the .DLL/.EXE is created. However visual studio is not building a new .DLL/.EXE because the related file is not an actual dependency for the output executable.

It would thus be better to exclude the <None Include="relatedFile.py"> to determine if the changed file is included in the project.

A changed unrelated file will complain that a lot of projects are not build

For example if the .gitignore or the .pre-commit-config.yaml is changed, and wants to be committed, then there is a high change that the build of all the projects is older, and thus not allowed to be committed.

The check should thus not be performed for files that are not related to the project itself.
Relevant files are: c/cpp/cxx/h/hpp/hxx/rc/vcxproj

Why isn't an error raised when the build is not present at all?

The pre-commit hook, does check if the build is outdated, or if the build was unsuccessful.
However if the source code was checked-out, and never been build yet, the hook doesn't detect that no build at all is present.

Wouldn't it be better if an error is raised if no 'build' was present yet at all?

When a partial commit is done, the file change time of the stashed files is updated, requiring a rebuild

When only a few (but not all) of the changed files are added in a commit, the other files are temporarily stashed. When the commit is finished, the stashed files are pop-ed from the stash again, however that changes the file change time.
When those files are then committed in a second commit, the check_successful_c_msbuild hook, is raising an error that the build is outdated, because of the newer source files.

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.