Skip to content

Commit

Permalink
Styling guideline finalised
Browse files Browse the repository at this point in the history
  • Loading branch information
vybhav72954 committed Jan 31, 2021
1 parent 44e5c7c commit 9b2c9de
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 125 deletions.
51 changes: 41 additions & 10 deletions .github/linters/Troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ In terms of style checking we have these actions -
We also have our own separate [STYLING GUIDELINES](../../README.md) as well, you are kindly requested to go through
that file in order to solve all the CODE related errors.

Please be advised that we may even reject a Working Pull Request, if it fails the minimum `Programming Styles and Standarads`.
Please be advised that we may even reject a Working Pull Request, if it fails the minimum
`Programming Styles and Standarads`.

In this Troubleshoot guide, we will help you to sort out all the errors related to.

Expand All @@ -30,7 +31,8 @@ In this Troubleshoot guide, we will help you to sort out all the errors related

All the Possible Error Codes are mentioned down below. Match your error-code and click on the Link.

This will take you to [markdownlint](https://github.com/DavidAnson/markdownlint). The rules of styling and possible errors have been taken from this Repository only.
This will take you to [markdownlint](https://github.com/DavidAnson/markdownlint).
The rules of styling and possible errors have been taken from this Repository only.

- **[MD001](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md001)** *heading-increment/header-increment* - Heading levels should only increment by one level at a time
- **[MD003](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md003)** *heading-style/header-style* - Heading style
Expand Down Expand Up @@ -74,27 +76,56 @@ This will take you to [markdownlint](https://github.com/DavidAnson/markdownlint)

## Check Spellings

This action lists out all the possible spelling mistakes in your `README.md` file. It is strongly suggested that you spellcheck all your files before uploading anything to maintain the aesthetics of the Repo. If there are spelling mistakes in your file, the action will fail, you can check the incorrect spelling as well.
This action lists out all the possible spelling mistakes in your `README.md` file.
It is strongly suggested that you spellcheck all your files before uploading anything to maintain the aesthetics
of the Repo. If there are spelling mistakes in your file, the action will fail,
you can check the incorrect spelling as well.

It is strongly advised to correct those spellings or the PR might be outright rejected. For more help Read our [STYLING GUIDELINES](../../README.md).
It is strongly advised to correct those spellings or the PR might be outright rejected.
For more help Read our [STYLING GUIDELINES](../../README.md).

If you believe that some words are wrongly pointed out and/or you want your name to be ignored by the Action.

It is recommended that you add the word to the [wordlist](.wordlist.txt).

Kindly note that any wrong edit can cause breaking changes.

Steps to Consider
Steps to Consider:

- Use `git checkout` to navigate to the branch in your remote which was used to open the PR.
- Add the required words in [wordlist](.wordlist.txt) **in your branch**.
- Remember to add a New Line after every word.
- `git add .`
- `git commit -m "Added Words in Wordlist"`
- `git push -u origin <branch>`
- Remember to add every word in a new line.
- Run the following command

```bash
git add .
git commit -m "Added Words in Wordlist"
git push -u origin <branch>`
```

## Check Markdown links

This action checks for dead links/broken links.

Kindly ensure that all the links are working before you finalize your Pull Request.
Kindly ensure that all the links are working before you finalize your Pull Request. A list of possible status code,
and the workaround can be found below.

- 200: Active code - Your link is working properly :grinning:
- 206: Partial success - Only a part of request is being successful, None the less, link is active :grinning:
- 400: Bad Request - A client side error, is there any typographical mistake, Recheck your README, try visiting the
site from your browser too! :thinking:
- 404: Not Found - The website is not responding, is it dead, recheck your README asap, correct the link or add an
alternative. :raised_eyebrow:
- 429: Too many requests - Overwhelming! Just surpassed the rate limit of the website, it's fine, the site is up and
running. :dizzy_face:
- 999: Blocked by agent - Everything is working fine, some agent like LinkedIN and Spotify block multiple request
from their side. It is recommended that you mention this in your PR, so that maintainers can affectively deal
with the error. :roll_eyes:
Don't worry maintainers are trying their best to keep the repository fully automated with minimal errors,
in case you find something you are more than welcome to mention it in your
[Pull Request](https://github.com/HarshCasper/Rotten-Scripts/pulls), open an
[Issue](https://github.com/HarshCasper/Rotten-Scripts/issues), or start a
[Discussion](https://github.com/HarshCasper/Rotten-Scripts/discussions).

**To know more about the _GitHub Actions_, consider checking _[Styling Guidelines](../../STYLE_GUIDELINES.md)_.**
165 changes: 88 additions & 77 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,117 @@
# Contributing Guidelines

This documentation contains a set of guidelines to help you during the contribution process.
We are happy to welcome all the contributions from anyone willing to improve/add new scripts to this project. Thank you for helping out and remember, **no contribution is too small.**
# Contributing Guidelines

This documentation contains a set of guidelines to help you during the contribution process.
We are happy to welcome all the contributions from anyone willing to improve/add new scripts to this project.
Thank you for helping out and remember, **no contribution is too small.**

Before anything, kindly go through our [Styling-Guidelines](STYLE_GUIDELINES.md) as well.

# Submitting Contributions👩‍💻👨‍💻
## Submitting Contributions👩‍💻👨‍💻

Below you will find the process and workflow used to review and merge your changes.
Below you will find the process and workflow used to review and merge your changes.

## Step 0 : Find an issue
### Step 0 : Find an issue

- Take a look at the Existing Issues or create your **own** Issues!
- Wait for the Issue to be assigned to you after which you can start working on it.
- Note : Every change in this project should/must have an associated issue.
![script](https://user-images.githubusercontent.com/44089458/86088644-5d4e7280-bac4-11ea-951d-18965e11877b.jpg)

## Step 1 : Fork the Project

- Fork this Repository. This will create a Local Copy of this Repository on your Github Profile. Keep a reference to the original project in `upstream` remote.
- Take a look at the Existing Issues or create your **own** Issues!
- Wait for the Issue to be assigned to you after which you can start working on it.
- Note : Every change in this project should/must have an associated issue.

```
$ git clone https://github.com/<your-username>/<repo-name>
$ cd <repo-name>
$ git remote add upstream https://github.com/<upstream-owner>/<repo-name>
![script](https://user-images.githubusercontent.com/44089458/86088644-5d4e7280-bac4-11ea-951d-18965e11877b.jpg)

### Step 1 : Fork the Project

- Fork this Repository. This will create a Local Copy of this Repository on your Github Profile.
Keep a reference to the original project in `upstream` remote.

```bash
git clone https://github.com/<your-username>/<repo-name>
cd <repo-name>
git remote add upstream https://github.com/<upstream-owner>/<repo-name>
```

![script1](https://user-images.githubusercontent.com/44089458/86088965-ebc2f400-bac4-11ea-80d3-80d5e52e4353.jpg)

- If you have already forked the project, update your copy before working.

```
$ git remote update
$ git checkout <branch-name>
$ git rebase upstream/<branch-name>
- If you have already forked the project, update your copy before working.

```bash
git remote update
git checkout <branch-name>
git rebase upstream/<branch-name>
```

## Step 2 : Branch
### Step 2 : Branch

Create a new branch. Use its name to identify the issue your addressing.
Create a new branch. Use its name to identify the issue your addressing.

```
```bash
# It will create a new branch with name Branch_Name and switch to that branch
$ git checkout -b branch_name
```
git checkout -b branch_name
```

## Step 3 : Work on the issue assigned
### Step 3 : Work on the issue assigned

- Work on the issue(s) assigned to you.
- Add all the files/folders needed.
- After you've made changes or made your contribution to the project add changes to the branch you've just created by:
- Work on the issue(s) assigned to you.
- Add all the files/folders needed.
- After you've made changes or made your contribution to the project add changes to the branch you've just created by:

```
```bash
# To add all new files to branch Branch_Name
$ git add .
git add .

# To add only a few files to Branch_Name
$ git add <some files>
git add <some files>
```

## Step 4 : Commit

- To commit give a descriptive message for the convenience of reviewer by:
### Step 4 : Commit

```
- To commit give a descriptive message for the convenience of reviewer by:

```bash
# This message get associated with all files you have changed
$ git commit -m "message"
```
git commit -m "message"
```

- **NOTE**: A PR should have only one commit. Multiple commits should be squashed.

## Step 5 : Work Remotely

- Now you are ready to your work to the remote repository.
- When your work is ready and complies with the project conventions, upload your changes to your fork:

```
# To push your work to your remote repository
$ git push -u origin Branch_Name
```
- **NOTE**: A PR should have only one commit. Multiple commits should be squashed.

### Step 5 : Work Remotely

- Now you are ready to your work to the remote repository.
- When your work is ready and complies with the project conventions, upload your changes to your fork:

```bash
# To push your work to your remote repository
git push -u origin Branch_Name
```

- Here is how your branch will look.
![br](https://user-images.githubusercontent.com/44089458/86090718-3d20b280-bac8-11ea-971d-15be55cfe259.jpg)

### Step 6 : Pull Request

- Here is how your branch will look.
![br](https://user-images.githubusercontent.com/44089458/86090718-3d20b280-bac8-11ea-971d-15be55cfe259.jpg)

## Step 6 : Pull Request

- Go to your repository in browser and click on compare and pull requests. Then add a title and description to your pull request that explains your contribution.
- Go to your repository in browser and click on compare and pull requests.
Then add a title and description to your pull request that explains your contribution.
<img width="677" alt="pr" src="https://user-images.githubusercontent.com/44089458/86090744-4b6ece80-bac8-11ea-9d69-a0098e9d4874.PNG">

<img width="882" alt="pullr" src="https://user-images.githubusercontent.com/44089458/86092345-fed8c280-baca-11ea-9a04-95991d9c60d2.PNG">
- Voila! Your Pull Request has been submitted and will be reviewed by the moderators and merged.🥳

## Need more help?🤔

You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, in case you are stuck:

- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-an-issue-or-pull-request)
- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github)
- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6)
- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github)


## Tip from us😇

It always takes time to understand and learn. So, do not worry at all. We know **you have got this**!💪
- Voila! Your Pull Request has been submitted and will be reviewed by the moderators and merged.🥳

### Need more help?🤔

You can refer to the following articles on basics of Git and Github and also contact the Project Mentors,
in case you are stuck:

- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-an-issue-or-pull-request)
- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github)
- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6)
- [Learn GitHub from Scratch](https://lab.github.com/githubtraining/introduction-to-github)

### Tip from us😇

It always takes time to understand and learn. So, do not worry at all. We know **you have got this**!💪

### Specific tips on Python?:snake:

You are a pythonista? Welcome aboard! Before anything, see our
[python contribution guide](Python/CONTRIBUTION-GUIDELINE.md) as well, it is basically
an extension to these guidelines.
22 changes: 13 additions & 9 deletions Python/CONTRIBUTION-GUIDELINE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Python Contribution Guidelines
# Python Contribution Guidelines

Welcome Contributors!!!

This guide is all about Python, how to code clean, quick and most importantly smart.

There is a lot o Python scripts in this repository, and we are constantly trying to update the code quality and guess
There is a lot o Python scripts in this repository, and we are constantly trying to update the code quality and guess
what!!! You can help us!!!.

__How?__ Just follow the below mentioned steps and you are good to go!
Expand Down Expand Up @@ -77,7 +77,7 @@ Refer to this [script](Github_Traffic) for a working example.
place**
- But as an example you should push a `.env.example` (It is a must). The file should be exactly similar to your `.env`
file but the API secret is replaced by `x` or anything.
- Note this file serves only as an example, it cant cause any security issue, unless you push your API key, kindly
- Note this file serves only as an example, it cant cause any security issue, unless you push your API key, kindly
double check everytime.

#### Auto Styling
Expand All @@ -99,29 +99,33 @@ We recommend using these auto formatting tools:
In order to auto format your files, follow these steps:

- Setup a `python 3.x virtual` environment.
- Activate the environment
- Install the dependencies using
```py
- Activate the environment.
- Install the dependencies using

```py
pip3 install yapf black autopep8
```

- Copy paste your python file in the Virtual environment, say the name of file is `main.py`.
- Now you can run

```bash
$ autopep8 --in-place main.py
$ yapf --in-place main.py
$ black main.py
autopep8 --in-place main.py
yapf --in-place main.py
black main.py
```

You can use any of the above code formatter or any combination to auto format your code as well.
In order to determine whether your code is up to the mark or not, we suggest using `PyLint`.

- Install `PyLint` using

```bash
pip3 insatll pylint
```

- Run on CLI

```bash
pylint simplecaeser.py
```
Expand Down
Loading

0 comments on commit 9b2c9de

Please sign in to comment.