Add contribution guidelines and docs
This commit is contained in:
73
CODE_OF_CONDUCT.md
Normal file
73
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,73 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
education, socio-economic status, nationality, personal appearance, race,
|
||||
religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [mst10041967@gmail.com]. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
52
CONTRIBUTING.md
Normal file
52
CONTRIBUTING.md
Normal file
@ -0,0 +1,52 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
**30 seconds of code** is powered by the community, so feel free to contribute in any way you can to help us!
|
||||
|
||||
## Tools
|
||||
|
||||
Before you begin contributing, you should install the integration-tools globally on your machine:
|
||||
|
||||
```sh
|
||||
npm install -g @30-seconds/integration-tools
|
||||
```
|
||||
|
||||
This will allow you to use our customized tools for all of our content repositories.
|
||||
|
||||
## How you can help
|
||||
|
||||
- Submit pull requests with new snippets (see guidelines below) or snippet updates (tags, descriptions, explanations, typos, examples, code improvements).
|
||||
- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues.
|
||||
|
||||
## Ground rules
|
||||
|
||||
Breaking any of these rules will result in your pull request being closed. Please follow these guidelines above all else:
|
||||
|
||||
- **Always be polite and respectful to others** and try to follow the advice of the moderators/collaborators/owners.
|
||||
- **Only modify snippet files**, never modify the generated files in the `snippet_data` directory.
|
||||
- **Use the integration tools commands** to generate new snippets, ensuring they have the correct name and are in the correct location.
|
||||
- **Follow snippet format exactly**, otherwise your snippets will not be recognized correctly by the tools responsible for publishing them on the website. This includes such things as spacing and empty lines - if you accidentally make a mistake, consult the repository's [snippet template](snippet-template.md).
|
||||
- **Snippets should solve real-world problems**, no matter how simple and should be abstract enough to be applied to different scenarios.
|
||||
|
||||
## Snippet creation
|
||||
|
||||
After installing the integration tools, you can run the following command:
|
||||
|
||||
```sh
|
||||
create-new-snippet <my-snippet-name>
|
||||
```
|
||||
|
||||
Replace `<my-snippet-name>` with the name of the snippet you are adding.
|
||||
|
||||
## Snippet guidelines
|
||||
|
||||
- Snippets must have all their frontmatter sections (title, tags etc.) filled.
|
||||
- Snippet titles must correspond to the filename and follow the language and repository's naming conventions.
|
||||
- Snippet tags must be comma-separated, contain a primary tag as seen on the website as their first tag and an expertise tag (`beginner`, `intermediate` or `advanced`) as their last tag.
|
||||
- Snippet descriptions must be short and to the point. Explain *what* the snippet does and detail *how* the snippet works and the language features used in it.
|
||||
- Snippet code and examples must be enclosed in appropriate, language-tagged blocks as shown in the snippet template, be short and use modern techniques and features. Also make sure to test your code before submitting.
|
||||
- If your snippet contains arguments with default parameters, explain what happens if they are omitted when calling the function and what the default case is. Specify default parameters for arguments only if necessary.
|
||||
- If your snippet uses recursion, use the `recursion` tag and explain the base cases.
|
||||
- Try to strike a balance between readability, brevity, and performance.
|
||||
- Always use soft tabs (2 spaces), never hard tabs.
|
||||
- Leave a single space after a comma (`,`) character (both in the description and code).
|
||||
- Define multiple variables on the same line, if possible. Use meaningful names (e.g. `letter` instead of `lt`) and follow existing conventions as seen in other snippets. Do not use trailing or leading underscores in variable names.
|
||||
28
README.md
28
README.md
@ -1,2 +1,26 @@
|
||||
# 30-seconds-git
|
||||
Short git snippets for all your development needs
|
||||
[](https://30secondsofcode.org/git/p/1)
|
||||
|
||||
# 30 seconds of Git
|
||||
|
||||
> Short Git code snippets for all your development needs
|
||||
|
||||
* Visit [our website](https://30secondsofcode.org) to view our snippet collection.
|
||||
* Use the [Search page](https://30secondsofcode.org/search) to find snippets that suit your needs. You can search by name, tag, language or using a snippet's description. Just start typing a term and see what comes up.
|
||||
* Browse the [Git Snippet List](https://30secondsofcode.org/git/p/1) to see all the snippets in this project or click individual tags at the top of the same page to narrow down your search to a specific tag.
|
||||
* Click on each snippet card to view the whole snippet, including code, explanation and examples.
|
||||
* You can use the button on the right side of a snippet card to copy the code to clipboard.
|
||||
* If you like the project, give it a star. It means a lot to the people maintaining it.
|
||||
|
||||
## Want to contribute?
|
||||
|
||||
* If you want to help us improve, take a minute to read the [Contribution Guidelines](/CONTRIBUTING.md) first.
|
||||
* Use the [Snippet Template](/snippet-template.md) to add new snippets to the collection.
|
||||
* If you find a problem with a specific snippet, please [open an issue](https://github.com/30-seconds/30-seconds-of-git/issues/new).
|
||||
* If you find a problem with the website, please [report it in the web repository](https://github.com/30-seconds/30-seconds-web/issues/new).
|
||||
|
||||
## Credits & Sponsors
|
||||
|
||||
* This repository is maintained by the [30-seconds organization on GitHub](https://github.com/30-seconds).
|
||||
* All snippets are licensed under the CC0-1.0 License, unless explicitly stated otherwise.
|
||||
* Logos, names and trademarks are not to be used without the explicit consent of the maintainers or owners of the 30 seconds GitHub organization.
|
||||
* Our website is powered by [Netlify](https://www.netlify.com/), [Gatsby](https://www.gatsbyjs.org/) & [GitHub](https://github.com/).
|
||||
|
||||
Reference in New Issue
Block a user