Giter VIP home page Giter VIP logo

Comments (4)

Dieterbe avatar Dieterbe commented on May 14, 2024

I just put this in my .vimrc:

autocmd BufWritePre *.py  :%s/\s\+$//e

If you make github alter commits you push to it (if that is even possible?), you'll run into all kinds of issues.
With a simple editor configuration like above (or a local hook) you can keep your commits clean locally, this is simpler and less confusing (i.e. commit hashes won't change)

Either way, you should always review diffs when merging changes or picking patches. And when you do, it's easy to spot newly introduced whitespace (if you have git coloring enabled)

from gensim.

piskvorky avatar piskvorky commented on May 14, 2024

Enforcing checks on GitHub doesn't seem to be possible. On the other hand, adding the check (pre-commit hook) locally is trivial, I added the instruction to https://github.com/piskvorky/gensim/wiki .

Contributors will now be advised to read that page first, before modifying the code in any way.

from gensim.

Dieterbe avatar Dieterbe commented on May 14, 2024

The suggested sed line on that page doesn't work when lines have ^M at the end.
If you use \s instead of :space: it will clean up trailing tabs, spaces and the ^M's as well.
Also I don't get why you supply an empty argument to sed before the statement, it will interpret this as an empty statement and the statement as a filename

from gensim.

piskvorky avatar piskvorky commented on May 14, 2024

Dieter, the [:space:] class in sed contains all whitespace characters (not just space, the name is perhaps misleading).

Also, in OS X (and other BSD systems I guess), the -i parameters needs a mandatory extension: providing empty '' means no backup will be created.

If your system behaves differently, you can add your version to the wiki (with some explanation).

from gensim.

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.