First of all, thank you for your interest in contributing and improving this project.
How you can contribute?
- Create bug or enhancement issue.
- Contribute with the code.
When to create issue?
- You have found bug/problem in code, dataset analysis, etc.
- You have found new dataset that can be included in this repository.
- You have idea how to improve the code/analysis flow, or existing analyses.
- You have specific question regarding code/analysis.
How to create issue?
- Create issue on GitHub repository issues.
- Assign appropriate label, one of the following:
enhancement
- you have found new dataset or have idea how to improve/enhance the repository,bug
- you have found bug/problem,question
- you have just specific question.
- Wait for responses/resolution of created issue.
- Fork the repository - this will add copy of this repository to your account.
- Clone the forked repository (make sure you have changed
<your_github_username>
):git clone https://github.com/<your_github_username>/fake-news-datasets.git cd fake-news-datasets
- Create your custom branch with provided prefix (one of
feature
orfix
) and name (see Branching styleguides section below):git checkout -b <prefix>/<name>
- Make needed changes in the code. Make sure your code meets Python styleguides (see Python code style section below) and repository rules and structure.
- Commit the changes (see Git commit styleguides section below):
git add <file|.> git commit -m "Insert first line commit message here" # Make sure that commit message meets styleguides
- Push changes to GitHub (make sure you have changed
<your_branch_name>
in following command):git push -u origin <your_branch_name>
- Create pull-request in GitHub from forked repository into origin one (see Pull-request styleguides section below).
- Wait until your changes are reviewed/merged. If some changes/enhancements are needed after code review, please incorporate changes.
When creating custom branch, please make sure the name of branch meets the following rules:
- Branch name must start with one of the prefixes:
feature/
- when adding new feature, new dataset, etc.,fix/
- fixing bug or any problem in repository.
- Words in branch names are separated by dash (
-
), example:feature/pheme-dataset
. - Do not create too long branch names, instead make them descriptive enough with just a few words.
When commiting the code changes, please make sure your commit messages meet following rules:
- Maximum length of first line of commit message is less than or equal to 72 characters.
- Make sure first line of commit message is in present tense and imperative mood (e.g. "Add feature...", instead of "Added feature..." or "Adds feature...").
- If needed, you can provide also further description of commit placed after first line of commit message. Make sure you have one empty line between first line and longer description.
When creating pull-request, please follow the guidelines:
- Add pull-request title. Please make sure that title is in present tense and imperative mood (e.g. "Add NEW_DATASET_NAME analysis").
- Put everything important into description of the pull-request.
- Assign appropriate label, one of the following:
enhancement
- you have implemented analysis of new dataset, or enhanced existing analyses, code, etc.,bug
- you have fixed existing bug/problem in code.
- Set code-reviewer (pmacinec).
- Create pull-request.
When contributing with Python code, please follow the styleguides:
-
Maximum length of line is 119 characters.
-
Please, make sure your code meets PEP8 standards (except maximum line length).
-
Add data types to all function arguments and return types.
-
To format strings, use
f-string
instead+
or.format()
. -
Add docstrings to all functions/classes. Docstrings style used in this repository is Google style. Example:
def example_function(a: int, b: str = ) ->:
"""
Example function simple description.
Further and longer description. Between first line of description and
longer description is one empty line. Between each of following parts (Args, Returns, Raises) is one empty line.
Args:
a: Number to calculate square of.
b: Random string to be printed.
Returns:
Square of parameter "a".
Raises:
ValueError: If "a" parameter is greater than 5.
"""
print(f'Random string: {b}')
if a > 5:
raise ValueError(f'Parameter a was greater than 5: {a}.')
return a * a
Another useful points to make code cleaner: The Zen of Python