-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance Makefile and add editorconfig #115
Conversation
@khos2ow thank you for your submission! As I see it, your pull request addresses many diverse things that should be split up into dedicated submissions. Obvious candidates are the |
To be honest I didn't want to create two PRs with only one file change in each (one for In terms of The release helper targets will potentially make the release process easier for the maintainers. When the time comes what needs to be done is essentially to decide which version bump is needed. Let's assume we want to go from
This will bump the version, create a tag with that version and push it to remote. And then release artifacts can be generated locally with |
@metmajer do you want to proceed with this PR? or any suggestion on breaking it down into smaller PRs? |
Yes, I do. Could you please...
Thanks! |
|
|
|
||
build-linux-amd64: | ||
GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/linux-amd64/$(NAME) | ||
.PHONY: lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sort the make targets in each block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
build-linux-amd64: | ||
GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/linux-amd64/$(NAME) | ||
.PHONY: lint | ||
lint: ## Run linter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure these comments are too helpful... lots of redundancy, hmm?
Makefile
Outdated
##################### | ||
## Release targets ## | ||
##################### | ||
.PHONY: release patch minor major |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let‘s keep the pattern of having a .phony above each target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Thanks for applying the changes, @khos2ow. Meanwhile, I have added some additional feedback. Aside, please...
|
I really like the idea, it can be done in Update: actually if you're ok with this I'd like to fix this in another PR of its own, because it needs to take care of brew formula as well. |
I totally agree with you on handling the brew formula update in a different PR, but a new release target should include an update of the Changelog. The updated Changelog should be contained in the tag, too. |
I just revisited the doc of git-chglog and the easiest (and cleanest) way we can do, from now on, is to prefix commit with keywords, such as
So instead of doing crazy hack to exclude |
The problem with the approach you‘ve mentioned is that this project has never followed structured commits. This is why our current git-chglog looks the way it is. If we were to introduce these groups now, old commit messages would not be shown anymore. Is there no easier approach? What if we check for and ignore that commit message in the template? Also, I am not a fan of structuring commit messages. Thoughts? |
Also, this hack can‘t be crazier than your version number hack in the Makefile 😀 |
Oh I see. I'm trying to see if I can make the config work to be able to generate the old commit message and generate new format from now on. If not successful manually remove the "Update Changelog" from the list. |
Ok I've managed to make changelog both backward and forward compatible:
@metmajer how do you want to proceed with this? |
Awesome! That‘s the approach we need. Will you make your changes part of this PR? If we require specific commit message prefixes, we may have to amend CONTRIBUTING.md. Hm? |
I think PR of its own would be better, because it will change Update: but to be frank, you don't need to follow the new commit title schema in your PRs, but the commits that go into master should follow them. So effectively 'squashed commit title' of a PR should follow that. |
Agree that we don‘t need to change CONTRIBUTING.md. If you already have a Changelog template available, I‘d really prefer to have it in here to complete the release target. If more work will be needed, let‘s conclude the PR here and add the template in an upcoming PR very soon. |
This commit 280835e will solve the template, but I prefer to have it in its own PR. If you feel like this is the correct place for it just proceed with this PR, otherwise let me know to revert that and open its own PR. |
There's only one gotcha point, that we have to start using the new format for commit message |
Prerequisites
Put an
x
into the box(es) that apply:For more information, see the Contributing Guide.
Description
This PR enhances the
Makefile
and its targets. List of changes:help
target and colorize the output logsverify
: Verify vendor dependenciesfmt
andcheckfmt
for go files formattingbuild-all
which builds for all the specified OS/ARCH as well as sha256sum filemajor
,minor
andpatch
which auto upgrade version to corresponding logical next versiontools
which installs any required tools for development or CI jobs-mod=vendor
and make sure the usage of Makefile targets will be universal, no matter if you're running it within GOPATH or outside of it.Also added
.editorconfig
file to enforce unified file coding, line ending, tab/space sizes etc on all different IDEs and text-editors.Added a
checkfmt
job on the CI pipeline as well to make sure we test code formatting on each PR as well. This means that if that job fails the formatting of go files are incorrect and can be fixed manually or by runningmake fmt
from the root of the repo.Issues Resolved
Fixes #67
Fixes #88
Checklist
Put an
x
into all boxes that apply:Tests
make test
.Documentation
Code Style