Giter Club home page Giter Club logo

Comments (12)

miki725 avatar miki725 commented on August 20, 2024 3

adding another blank line fails precommit scripts too https://github.com/pre-commit/pre-commit-hooks/blob/master/pre_commit_hooks/end_of_file_fixer.py

in my case version bump is part of ci process which results in precommit failures like:

hookid: end-of-file-fixer

Files were modified by this hook. Additional output:

Fixing .bumpversion.cfg

would be nice to make this configurable. meanwhile have to skip precommit on bump file itself

from bumpversion.

imZack avatar imZack commented on August 20, 2024 2

Yep, I think it shouldn't append another additional blank line.

from bumpversion.

peritus avatar peritus commented on August 20, 2024

Seems like a warning originating from git / your specific git config. Can you post your git config --list output (please remember strip auth tokens etc. (!)) ?

from bumpversion.

imZack avatar imZack commented on August 20, 2024

Cool, thanks for your response. This is my git config --list result, I can't find any related config inside.

[email protected]
user.name=YuLun Shih
core.editor=vim
url.https://.insteadof=git://
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true

from bumpversion.

peritus avatar peritus commented on August 20, 2024

I might have fixed this as part of making the tests run on windows (are you running windows btw?) here: #64 (comment)

Can you install the current version by executing

pip install https://github.com/peritus/bumpversion/archive/master.zip#egg=bumpversion-dev

and let me know if the problem still persists ?

from bumpversion.

imZack avatar imZack commented on August 20, 2024

It works like a charm :bowtie: TY!

from bumpversion.

peritus avatar peritus commented on August 20, 2024

Just curious, are you using windows ?

from bumpversion.

imZack avatar imZack commented on August 20, 2024

@peritus Oop! I just found out If I use nano editor it works! It only happens when I use sublime text with editorconfig plugin.
Btw, I am using Debian.

This is my .editorconfig file

# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

# We recommend you to keep these unchanged
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
# Change these settings to your own preference
indent_style = space
indent_size = 2

[*.py]
# Change these settings to your own preference
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

from bumpversion.

peritus avatar peritus commented on August 20, 2024

http://stackoverflow.com/questions/27059239/git-new-blank-line-at-eof seems to be a valuable resource here.

from bumpversion.

peritus avatar peritus commented on August 20, 2024

This could be the culprit:

insert_final_newline = true

As far as I understand it's recommended to have a newline character (also known as \n) at the end of a file, but not a 'blank line' (that's what git is complaining about here).

from bumpversion.

imZack avatar imZack commented on August 20, 2024

Yes, I have read this article before, but what I am noticed is after executing bumpversion patch the .bumpversion.cfg is added "another blank line" for me. That cause the problem.

from bumpversion.

peritus avatar peritus commented on August 20, 2024

You're right. bumpversion indeed adds a blank line to the config file after writing. The question is: Should it ?

from bumpversion.

Related Issues (20)

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.