Skip to content

Commit 2cf0921

Browse files
authored
Initial commit
0 parents  commit 2cf0921

16 files changed

+1953
-0
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contribute to <Project_Name>
2+
3+
Thank you for taking the time to contribute to <project_name>! We really appreciate it.
4+
5+
Before contributing, please make sure to read the [Code of Conduct](../../CODE_OF_CONDUCT.md). We expect you to follow it in all your interactions with the project.
6+
7+
## New to <Project_Name>?
8+
9+
If you are new to <Project_Name>, please take a look at the [documentation](./Project_Tour.md). It is a great place to start.
10+
11+
## New Contributor Guide
12+
13+
To get an overview of the codebase, check out the '[README.md](../src/README.md)' file in the `src` directory.
14+
15+
that will help you understand the structure of the project.
16+
17+
## How to Contribute
18+
19+
### Reporting Bugs
20+
21+
If you find a bug in the source code, you can help us by [submitting an issue](../ISSUE_TEMPLATE/bug_report.yaml).
22+
23+
### Suggesting Enhancements
24+
25+
If you want to suggest an enhancement to <Project_Name>, please [submit an issue](../ISSUE_TEMPLATE/feature_request.yaml).
26+
27+
### Pull Requests
28+
29+
If you want to contribute to <Project_Name>, submit a pull request.
30+
31+
- url: `https://github.com/OPCODE-Open-Spring-Fest/<project_Name>/compare/branch...YOURGITHUBUSERNAME:<project_Name>:BRANCH?quick_pull=1&template=pr.md`
32+
33+
### Requirements
34+
35+
36+
### Setup
37+
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Project Tour
2+
3+
* notes:
4+
* > Discuss about your project file structure
5+
* > what each folder is responsible
6+
* > then go through each file in folders and explain there purpose
7+
* > if possible create a doc system ( there are autogen docs available for most of the languages )
8+
* > decide coding style , linting style and formatting style and other themes like variable naming etc.
9+
* > provide an example for existing function and tests system if possible
10+
*
11+
12+
# MAKE SURE PROJECT MANAGERS UPDATE THIS MD
+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Commiting Guidelines
2+
3+
## Commit Structure
4+
5+
- **Make Commits Atomic**: Each commit should represent a single logical change. Avoid mixing multiple changes in a single commit. If a change affects multiple files, ensure it constitutes one "logical" change.
6+
7+
### Writing Commit Messages
8+
9+
- **Clear Subject Line**: Start the commit message with a clear and concise description of the change. It should be no more than 50 characters, start with a capital letter, and be in imperative mood.
10+
11+
- > ```bash
12+
> feat: Add function to calculate average
13+
> ```
14+
15+
- **Separate Subject from Body**: If further explanation is needed, include it in the body of the commit message, following a blank line after the subject line.
16+
17+
- **Explain the Change**: The body of the commit message should explain why the change was needed and how it was implemented. Keep it wrapped to 72 characters and written in present tense.
18+
19+
- > ```bash
20+
> fix: Resolve issue with login form not submitting on Safari
21+
>
22+
> This commit fixes a bug where the login form was not submitting on Safari browsers. The issue was caused by an outdated event listener binding, which has been updated to the correct syntax.
23+
> ```
24+
25+
- **Avoid "How" Details**: Use the commit message to explain what changes were made and why, not how they were made. Well-written code should be self-explanatory.
26+
27+
- **Reference Issues or Pull Requests**: If the commit is related to an issue or a pull request, include the reference in the commit message. This can be done in the body of the message or at the end.
28+
29+
- > ```bash
30+
> feat: Add user authentication feature
31+
>
32+
> Closes #123
33+
> ```
34+
35+
- **Avoid Unnecessary Punctuation**: Do not end the subject line with a period.
36+
37+
### Commit Message Structure Rules
38+
39+
- **Type Enum**: Ensure your commit type matches one of the predefined values: `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`.
40+
41+
- `build`: This type is used for changes related to build processes or tools. It includes modifications to build scripts, configuration files, and build-related dependencies.
42+
43+
- `chore`: Chore changes typically involve tasks related to maintenance or housekeeping. This could include updating dependencies, cleaning up code, or configuring development tools.
44+
45+
- `ci`: Changes related to Continuous Integration (CI) configuration files and scripts fall under this type. It includes modifications to CI pipelines, configurations for automated testing, and integration with CI services.
46+
47+
- `docs`: Documentation changes belong to this type. It covers updates to documentation files, such as READMEs, API documentation, or inline code comments.
48+
49+
- `feat`: This type is for new feature implementations or enhancements to existing features. It signifies significant additions or improvements to the codebase's functionality.
50+
51+
- `fix`: Use this type for bug fixes or patches. It indicates changes made to address issues or bugs in the codebase.
52+
53+
- `perf`: Performance-related changes are categorized under this type. It includes optimizations aimed at improving the codebase's performance, such as reducing execution time or memory usage.
54+
55+
- `refactor`: Refactoring changes fall under this type. It involves restructuring or cleaning up the code without changing its external behavior. Refactoring aims to improve code quality, maintainability, or readability.
56+
57+
- `revert`: Reverting changes made in a previous commit is indicated by this type. It's used when undoing the effects of a specific commit, often to address unexpected issues or regressions introduced by the previous change.
58+
59+
- `style`: Style-related changes belong to this type. It covers modifications to code style, formatting, or whitespace, without affecting the code's functionality.
60+
61+
- `test`: Test-related changes are categorized under this type. It includes additions or modifications to test cases, test suites, or testing infrastructure to ensure code correctness and reliability.
62+
63+
- **Type Case**: Use lowercase for commit types.
64+
65+
- **Subject Not Empty**: The subject line should not be empty.
66+
67+
- **Subject Case**: Use sentence case for the subject line.
68+
69+
- **Subject Length**: Keep the subject line under 100 characters.
70+
71+
- **Body Leading Blank**: Ensure there's a leading blank line in the commit body.
72+
73+
- **Body Max Line Length**: Keep each line in the commit body under 100 characters.
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
labels: ["Issue:bug"]
5+
assignees:
6+
- <project_manager>
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this bug report!
12+
- type: textarea
13+
id: what-happened
14+
attributes:
15+
label: Description
16+
description: Also tell us, what did you expect to happen?
17+
placeholder: Tell us what you see!
18+
value: "Describe the issue happened"
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: error-message
23+
attributes:
24+
label: Error message
25+
description: If applicable, please provide the error message you received.
26+
placeholder: Copy and paste the error message here
27+
validations:
28+
required: false
29+
- type: dropdown
30+
id: severity
31+
attributes:
32+
label: Severity
33+
description: How severe is the bug?
34+
options:
35+
- Low
36+
- Medium
37+
- High
38+
- Critical
39+
- type: textarea
40+
id: steps
41+
attributes:
42+
label: Steps to reproduce
43+
description: Please provide detailed steps for reproducing the issue.
44+
placeholder: Tell us how to reproduce the issue
45+
value: "1. 2. 3."
46+
validations:
47+
required: true
48+
- type: textarea
49+
id: environment
50+
attributes:
51+
label: Environment
52+
description: Please provide details about your environment.
53+
placeholder: Tell us about your environment
54+
value: "OS: \nBrowser: \nVersion: \nLanguage:..."
55+
- type: textarea
56+
id: screenshots
57+
attributes:
58+
label: Screenshots
59+
description: If applicable, add screenshots to help explain your problem.
60+
placeholder: Drag and drop your screenshots here
61+
62+
- type: textarea
63+
id: logs
64+
attributes:
65+
label: Relevant log output
66+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
67+
render: shell
68+
- type: checkboxes
69+
id: terms
70+
attributes:
71+
label: Code of Conduct
72+
description: By submitting this issue, you agree to follow our [Code of Conduct](../Code_of_Conduct.md)
73+
options:
74+
- label: I agree to follow this project's Code of Conduct
75+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Feature Request
2+
description: Request a feature or suggest us what is in your mind!
3+
title: "[Feature]: "
4+
labels: "Issue:feature"
5+
assignees:
6+
- <project manager>
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Please explain what is in your mind, we would like to hear it from you! 🤠
12+
13+
14+
- type: textarea
15+
id: explaining
16+
attributes:
17+
label: So, what is it about?
18+
description: Please describe what you're requesting for. So, we Akarui Team can understand your request better and work on it faster!
19+
placeholder: It's about...
20+
validations:
21+
required: true
22+
23+
- type: checkboxes
24+
id: terms
25+
attributes:
26+
label: Code of Conduct
27+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OPCODE-Open-Spring-Fest/template/blob/main/.github/Contributor_Guide/CODE_OF_CONDUCT.md)
28+
options:
29+
- label: I agree to follow this project's Code of Conduct
30+
required: true

.github/PULL_REQUEST_TEMPLATE/pr.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
## Description
3+
4+
> Give a brief description of the pull request.
5+
6+
## Semver Changes
7+
8+
- [ ] Patch (bug fix, no new features)
9+
- [ ] Minor (new features, no breaking changes)
10+
- [ ] Major (breaking changes)
11+
12+
## Issues
13+
14+
> List any issues that this pull request closes.
15+
16+
## Checklist
17+
18+
- [ ] I have read the [Contributing Guidelines](../Contributor_Guide/Contruting.md).
19+

.github/workflows/commitlint.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
commitlint:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 0
12+
- name: Install required dependencies
13+
run: |
14+
sudo apt update
15+
sudo apt install -y sudo
16+
sudo apt install -y git curl
17+
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
18+
sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
19+
- name: Print versions
20+
run: |
21+
git --version
22+
node --version
23+
npm --version
24+
npx commitlint --version
25+
- name: Install commitlint
26+
run: |
27+
npm install conventional-changelog-conventionalcommits
28+
npm install commitlint@latest
29+
30+
- name: Validate current commit (last commit) with commitlint
31+
if: github.event_name == 'push'
32+
run: npx commitlint --from HEAD~1 --to HEAD --verbose
33+
34+
- name: Validate PR commits with commitlint
35+
if: github.event_name == 'pull_request'
36+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

.github/workflows/prmerged.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: On Pull Request Merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
9+
on-merge:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.pull_request.merged == true }}
12+
steps:
13+
- name: Get Pull Request Data
14+
id: get-pr-data
15+
env:
16+
PULL_REQUEST_OWNER: ${{ github.event.pull_request.user.login }}
17+
PULL_REQUEST_LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }}
18+
run: |
19+
echo "::set-output name=owner::$PULL_REQUEST_OWNER"
20+
echo "::set-output name=labels::$PULL_REQUEST_LABELS"
21+
22+
- name: Send Data to API
23+
env:
24+
API_URL: https://osf-api.onrender.com/api/prmerged
25+
API_AUTH_TOKEN: ${{ secrets.API_AUTH_TOKEN }}
26+
run: |
27+
payload=$(echo '{"owner":"${{ steps.get-pr-data.outputs.owner }}","labels":"${{ steps.get-pr-data.outputs.labels }}"}' | jq -R -s .)
28+
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $API_AUTH_TOKEN" -d "$payload" "$API_URL"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run commitlint ${1}

.husky/pre-commit

Whitespace-only changes.

0 commit comments

Comments
 (0)