Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📚 Update docs package #49

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
## Contribution Guidelines

Thank you for your interest in contributing to our package! This document outlines the tools and steps to follow to ensure a smooth and consistent workflow.

## Contribution Workflow

1. **Fork and Clone**: Fork the repository and clone it to your local machine.
```bash
git clone https://github.com/sageteamorg/sage-imap.git
cd sage_imap
```

2. **Create a Branch**: Create a new branch for your feature or bugfix.
```bash
git checkout -b feature/your-feature-name
```

3. **Install Dependencies**: Use Poetry to install dependencies.
```bash
poetry install
```

4. **Write Code and Tests**: Make your changes and write tests for your new code.

5. **Run Code Quality Checks**: Ensure code quality with pre-commit, Ruff, and Pylint.
```bash
pre-commit run --all-files
ruff check sage_newsletter --fix
pylint sage_imap
```

6. **Run Tests**: Ensure all tests pass using Poetry.
```bash
poetry run pytest
```

7. **Commit Changes**: Use Commitizen to commit your changes.
```bash
cz commit
```

8. **Push and Create a PR**: Push your changes and create a pull request.
```bash
git push origin feature/your-feature-name
```

9. **Bump Version**: Use Commitizen to bump the version.
```bash
cz bump
```

10. **Generate Changelog**: Use Commitizen to generate the changelog.
```bash
cz changelog
```

11. **Export Dependencies**: Export dependencies for development and production.
```bash
poetry export -f requirements.txt --output packages/requirements.txt --without-hashes
poetry export -f requirements.txt --dev --output packages/requirements-dev.txt --without-hashes
```

## Commitizen Message Rule

Commitizen follows the Conventional Commits specification. The commit message should be structured as follows:

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

Here are 10 examples of commit messages following the Commitizen Conventional Commits specification:

### 1. Initialization of core
```
feat(core): initialize the core module

- Set up the core structure
- Added initial configurations and settings
- Created basic utility functions
```

### 2. Release with build and tag version
```
chore(release): build and tag version 1.0.0

- Built the project for production
- Created a new tag for version 1.0.0
- Updated changelog with release notes
```

### 3. Adding a new feature
```
feat(auth): add user authentication

- Implemented user login and registration
- Added JWT token generation and validation
- Created middleware for protected routes
```

### 4. Fixing a bug
```
fix(api): resolve issue with data fetching

- Fixed bug causing incorrect data responses
- Improved error handling in API calls
- Added tests for the fixed bug
```

### 5. Update a doc (Sphinx)
```
docs(sphinx): update API documentation

- Updated the Sphinx documentation for API changes
- Added examples for new endpoints
- Fixed typos and formatting issues
```

### 6. Update dependencies (packages)
```
chore(deps): update project dependencies

- Updated all outdated npm packages
- Resolved compatibility issues with new package versions
- Ran tests to ensure no breaking changes
```

### 7. Update version for build and publish
```
chore(version): update version to 2.1.0 for build and publish

- Incremented version number to 2.1.0
- Updated package.json with the new version
- Prepared for publishing the new build
```

### 8. Adding unit tests
```
test(auth): add unit tests for authentication module

- Created tests for login functionality
- Added tests for registration validation
- Ensured 100% coverage for auth module
```

### 9. Refactoring codebase
```
refactor(core): improve code structure and readability

- Refactored core module to enhance readability
- Extracted utility functions into separate files
- Updated documentation to reflect code changes
```

### 10. Improving performance
```
perf(parser): enhance parsing speed

- Optimized parsing algorithm for better performance
- Reduced the time complexity of the parsing function
- Added benchmarks to track performance improvements
```

These examples cover various types of commits such as feature additions, bug fixes, documentation updates, dependency updates, versioning, testing, refactoring, and performance improvements.
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Thank you for considering contributing to `python-sage-imap`! We welcome contrib
- [Getting Started](#getting-started)
- [Running Tests](#running-tests)
- [Code Style](#code-style)
- [Security Checks](#security-checks)
- [Pre-commit Hooks](#pre-commit-hooks)
- [Setting Up Pre-commit Hooks](#setting-up-pre-commit-hooks)
- [Submitting a Pull Request](#submitting-a-pull-request)
Expand Down Expand Up @@ -65,7 +66,19 @@ Additionally, we use `flake8` and `pylint` for linting. You can run these tools

```bash
poetry run flake8
poetry run pylint django_sage_email
poetry run pylint sage_imap
```

## Security Checks

We use `bandit` to perform security checks on our codebase. Bandit helps identify common security issues in Python code.

### Running Bandit

To run Bandit with the current configuration:

```bash
poetry run bandit -c pyproject.toml
```

## Pre-commit Hooks
Expand Down
24 changes: 9 additions & 15 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,20 @@ We would like to thank the following people for their contributions to the `pyth
## Core Contributors

- **Sepehr Akbarzadeh**
- GitHub: [sageteam](https://github.com/sa-goldeneagle)
- GitHub: [Sepehr akbarzadeh](https://github.com/sepehr-akbarzadeh)
- Email: sepehr@sageteam.org
- Contributions: Project creator and lead maintainer.

## Contributors
- **Mohammad Fotouhi**
- GitHub: [MohmdFo](https://github.com/MohmdFo)
- Email: mohammad@sageteam.org
- Contributions: maintainer.

The following individuals have contributed to the project through issues, code, and documentation:
- **Aryan Niknezhad**
- GitHub: [ARYAN-NIKNEZHAD](https://github.com/ARYAN-NIKNEZHAD)
- Email: aryan513966@gmail.com
- Contributors: maintainer

- **Your Name**
- GitHub: [your-github-username](https://github.com/your-github-username)
- Contributions: Description of contributions (e.g., "Implemented feature X, fixed bug Y").

- **Another Contributor**
- GitHub: [another-github-username](https://github.com/another-github-username)
- Contributions: Description of contributions (e.g., "Improved documentation, added tests for feature Z").

## Special Thanks

- **Special Thanks Name**
- Contributions: Description of contributions (e.g., "Provided valuable feedback on the initial design, helped with testing.").

---

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

© 2024 Sepehr Akbarzadeh
© 2024 SAGE Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. Django Sage Email documentation master file, created by
.. Python Sage IMAP documentation master file, created by
sphinx-quickstart on Mon Jan 01 00:00:00 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to Django Sage Email's documentation!
Welcome to Python Sage IMAP's documentation!
=============================================

.. toctree::
Expand Down
Loading