Skip to content
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

Alohomora v2.0.0 #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,31 @@ Contributions to this repository are highly appreciated, but there are few thing
As Joel Spolsky once quoted, _It's harder to read code than to write it_.

## Getting Started
* Create or log in with a Github account to start contributing.
* Look for [issues](https://github.com/z0o0p/alohomora/issues) to work on, or [create](https://github.com/z0o0p/alohomora/issues/new) a new issue. Ensure that your issue is not similar to the existing ones.
* It is recommended that you share your approach by commenting on that issue beforehand.
* When ready to work, [fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) this repository to your account.
* Please go through the project files and get an idea about the project to avoid confusions.

#### Setup
Run the setup script which will help you get started.
```
sudo bash setup/setup.sh
```

## Making Changes
* Please avoid working directly on the `master` branch by creating a `dev` branch from it.
* Please avoid working directly on the `master` branch. Checkout to a `develop` branch from it.
* Follow the [code style](https://docs.elementary.io/develop/writing-apps/code-style) as recommended by elementary OS.
* Make commits after every logical unit.
* Ensure that your commit messages follow the below format. The commit message should be brief but could be expressive if you feel it is needed.

#### Commit Message
The commit message should follow the below format.
```
Fix/Update/Add - Commit Message
Type(Optional Scope) - Message

Optional Body
```
The commit type could be Add, Fix or Update.

## Submitting Changes
* Push your changes to the `dev` branch in your forked repository.
* Create a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to Alohomora repository.
* Push your changes, and create a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to the Alohomora repository.
* Please mention the associated issue and describe the changes/additions to the code base.

11 changes: 11 additions & 0 deletions setup/files/commit-msg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

allowed_message_format='^(Add|Update|Fix)(\(.+\))? - (.|\n)+'
commit_message=$(<$1)

if ! [[ "$commit_message" =~ $allowed_message_format ]]; then
echo "Error: Invalid commit message format. Please refer to the contributing guidelines."
exit 1
fi
exit 0

21 changes: 21 additions & 0 deletions setup/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

function setupGitHooks() {
GIT_HOOKS_DIR=.git/hooks

git config --local core.hooksPath $GIT_HOOKS_DIR

rm $GIT_HOOKS_DIR/commit-msg*
cp setup/files/commit-msg.sh $GIT_HOOKS_DIR/commit-msg
chmod +x $GIT_HOOKS_DIR/commit-msg
}

function installDependencies() {
sudo apt install -y meson valac libgtk-3-dev libgranite-dev libsecret-1-dev
}

echo "Setting up the dev environment for Alohomora..."
setupGitHooks
installDependencies
echo "Done!"