Tag: coding style

Where to hook a coding convention script?

When working in large teams code styling tools are often used to enforce coding convention compliance. The problem is not to find such a tool. It is more the question of, when you execute this tool? When do you execute this tool (e.g. astyle)? I worked in projects, that are using the first two approaches. […]

Reject commit in Git if Java code style isn't correct

Can anyone recommend an approach to have my Git repo reject commits if the Java code being committed doesn’t conform to a predefined coding standard. I’m fed up of seeing a mix of tabs and spaces and a commit log with entries such as ‘Converting tabs to spaces’. I have Eclipse configured to automatically perform […]

Enforcing coding style with pre-receive Git hook

I am working on an embedded Linux project with a small team, and we have decided to enforce a C coding style. We have chosen the Linux Kernel coding style, and we use the script provided in the Kernel tree checkpatch.pl to check our patches. We would like to check the coding style before accepting […]

Ensure coding-style during a git commit

Im my company i set-up a continuous integration test and i run the tests when someone push the code on the server. Now i want to check that the code match with the our basic coding rules, the first rule is “run mogrify on your code!” There is something to do this check “out the […]

Which style do you use for your commit messages? Technical or feature-based?

Lets say you are working on a some type of web applications. Here are the 2 different versions of commit messages for the same change set. Redirect user to user_profile for public controllers -or- Restrict logged in user acces to public controllers Add require_guest before filter to necessary controllers The first one explains what is […]

Why maintain traditional detailed ChangeLog in modern world (with SVN, Mercurial, Git)?

Detailed ChangeLog entry usually tell who, when and what function changed and for why this change done. And this for every separate function in the source code tree! As I understand ChangeLog come from past when there were no good VCS. So traditional ChangeLog doesn’t need at all as you can get it all from: […]

Checking in of “commented out” code

Ok, here is something that has caused some friction at my current job and I really didn’t expect it to. Organized in house software development is a new concept here and I have drawn up a first draft of some coding guidelines. I have proposed that “commented out” code should never be checked into the […]

Should commit messages be written in present or past tense?

So which is it that you think is better and more intuitive? Fixed the XXX bug in YYY Fix the XXX bug in YYY Fixes the XXX bug in YYY Fixing the XXX bug in YYY Please provide your rationales. Note I am asking from your general perspective, meaning you should not try to associate […]

Are there any free cmd-line scripts which can re-format PHP source-code?

I’m using a pre-commit hook to lint-check PHP source submitted by our staff, and everyone’s really happy with the results. The staff have agreed it would be useful to have the code re-formatted to follow (customizable) style rules on commit. Are there any FOSS scripts which can do this from the command-line?

How to accommodate multiple coding styles? (git vs. IDE)

I am collaborating on a git-sourced, maven-managed Java project with differing code styling preferences with users using multiple IDE’s (note 1). Is there a tool or IDE configuration that will allow code to be viewed and edited using style-1, but committed to SCM using style-2? My research points me to ‘no’, but a solution combining […]

Git Baby is a git and github fan, let's start git clone.