Skip to content

Latest commit

 

History

History
237 lines (150 loc) · 8.87 KB

CONTRIBUTING.md

File metadata and controls

237 lines (150 loc) · 8.87 KB

Contributing to github-automated-repos

Contribute to the library getting better and better! As a contributor, here are the guidelines we would like you to follow:

Found a Bug?

If you find a bug in the source code, you can help us by submitting an issue to our GitHub Repository Even better, you can submit a Pull Request with a fix.

Missing a Feature?

You can request a new feature by submitting an issue to our GitHub Repository. If you would like to implement a new feature, please consider the size of the change in order to determine the right steps to proceed:

  • For a Major Feature, first open an issue and outline your proposal so that it can be discussed. This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.

    Note: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature.

  • Small Features can be crafted and directly submitted as a Pull Request.

Submitting an Issue

You can file new issues by selecting from our new issue templates and filling out the issue template.

Before you submit your Pull Request (PR) consider the following guidelines:

  1. Search GitHub for an open or closed PR that relates to your submission. You don't want to duplicate existing efforts.

  2. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add. Discussing the design upfront helps to ensure that we're ready to accept your work.

  3. Fork the github-atuomated-repos.

  4. In your forked repository, make your changes in a new git branch:

    git checkout -b my-fix-branch main
  5. Follow our Coding Rules.

  6. Commit your changes using a descriptive commit message that follows our commit message conventions. Adherence to these conventions is necessary because release notes are automatically generated from these messages.

    git commit --all

    Note: the optional commit -a command line option will automatically "add" and "rm" edited files.

  7. Push your branch to GitHub:

    git push origin my-fix-branch
  8. In GitHub, send a pull request to github-automated-repos:main.

Reviewing a Pull Request

If pull requests are not accepted due to being outside the code of conduct applied in github-automated-repos, follow these procedures:

Addressing review feedback

If we ask for changes via code reviews then:

  1. Make the required updates to the code.

  2. Create a fixup commit and push to your GitHub repository (this will update your Pull Request):

    git commit --all --fixup HEAD
    git push

    For more info on working with fixup commits see here.

That's it! Thank you for your contribution!

Updating the commit message

A reviewer might often suggest changes to a commit message (for example, to add more context for a change or adhere to our commit message guidelines). In order to update the commit message of the last commit on your branch:

  1. Check out your branch:

    git checkout my-fix-branch
  2. Amend the last commit and modify the commit message:

    git commit --amend
  3. Push to your GitHub repository:

    git push --force-with-lease

NOTE:
If you need to update the commit message of an earlier commit, you can use git rebase in interactive mode. See the git docs for more details.

After your pull request is merged

After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:

  • Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

    git push origin --delete my-fix-branch
  • Check out the main branch:

    git checkout main -f
  • Delete the local branch:

    git branch -D my-fix-branch
  • Update your local main with the latest upstream version:

    git pull --ff upstream main

Coding Rules

To ensure consistency throughout the source code, keep these rules in mind as you are working:

Commit Message Format

Commit Message Header

Each commit message consists of a header, a body

The header is mandatory and must conform to the Commit Message Header format.

The body is mandatory for all commits except for those of type "docs". When the body is present it must be at least 20 characters long and must conform to the Commit Message Body format.

Commit Message Header

<type>(<scope>): <short summary>
  │       │             │
  │       │             └─⫸ Summary in present tense. Not capitalized. No period at the end.
  │       │
  │       └─⫸ Commit Scope: useGithubAutomatedRepos|dataReposGithub|projectIcon|stackIcon|iGithubRepos
  │
  └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test

The <type> and <summary> fields are mandatory, the (<scope>) field is optional.

Commit types

Must be one of the following:

Commit Type Description
feat A new feature
fix A bug Fix
docs Updates to documentation such as a the README or other markdown files
style Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor A code change that neither fixes a bug nor adds a feature
perf A code change that improves performance
test Adding missing tests or correcting existing tests
build Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
ci The commit makes changes to continuous integration or continuous delivery scripts or configuration files.
chore Changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)
revert Reverts a previous commit
Scope

The scope should be the name related to the affected area of the library (as perceived by the person reading the changelog generated by commit messages):

The following is the list of supported scopes:

  • useGithubAutomatedRepos
  • dataReposGithub
  • projectIcon
  • stackIcon
  • iGithubRepos
Summary

Use the summary field to provide a succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize the first letter
  • no dot (.) at the end

Commit Message Body

Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".

Explain the motivation for the change in the commit message body. This commit message should explain why you are making the change. You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change.