diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c7a4165 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*] +indent_style = space +tab_width = 4 +indent_size = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index c18dd8d..ac9285e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,101 @@ +#Emacs backup files +*.*~ + +# Byte-compiled / optimized / DLL files __pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# IPython Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# asdf +.tool-versions + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +.venv/ +venv/ +ENV/ +venv_*/ + +/ATTIC +/*.iml +.idea + +/bin +/include +/pip-selfcheck.json + +.DS_Store +/SECRETS +*/**/ATTIC + +# IDE configs +.vscode +.nvimrc +.vimrc + +mypy.ini diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7dec4c9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +default_language_version: + python: python3 + +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.3.5 + hooks: + # Run the linter. + - id: ruff + args: [ --fix ] + # Run the formatter. + - id: ruff-format diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md new file mode 100644 index 0000000..13f8632 --- /dev/null +++ b/CONTRIBUTION.md @@ -0,0 +1,41 @@ +## Contributing Guidelines + +Thank you for considering contributing to our project! We welcome contributions from everyone. To maintain a positive and collaborative environment, please follow these guidelines: + +### Creating Issues: + +1. **Search Existing Issues**: Before creating a new issue, please search existing issues to see if the topic has already been discussed or reported. + +2. **Clear and Descriptive Title**: Provide a clear and descriptive title for your issue, summarizing the problem or enhancement. + +3. **Detailed Description**: Provide a detailed description of the issue, including steps to reproduce (if applicable), expected behavior, and actual behavior. + +4. **Use Labels**: Use appropriate labels to categorize your issue (e.g., bug, enhancement, documentation, etc.). + +### Pull Requests (PRs): + +1. **Fork the Repository**: Start by forking the repository to your GitHub account. + +2. **Clone the Repository**: Clone the forked repository to your local machine using the `git clone` command. + +3. **Create a Branch**: Create a new branch for your contribution. Use descriptive and concise names for your branches. Avoid using special characters and whitespace. + +4. **Make Changes**: Make your desired changes to the codebase. + +5. **Code Style:** Follow the existing code style and conventions. Ensure proper indentation, variable naming, and commenting. + +5. **Test Your Changes**: Ensure that your changes do not break existing functionality. Write test cases to cover your code changes. Ensure that existing tests pass successfully. + +6. **Commit Your Changes**: Commit your changes. Write clear and meaningful commit messages. Include a brief summary in the first line followed by a more detailed description if necessary. + +7. **Push Changes**: Push your changes to your forked repository. + +8. **Submit a Pull Request (PR)**: Once you have pushed your changes, submit a pull request to the main repository. Use a descriptive title for your pull request that summarizes the changes made. + +9. **Review Process**: Your PR will be reviewed by project maintainers. Please be patient during the review process and be open to feedback and suggestions. + +10. **Merge PR**: If your PR is approved, it will be merged into the main repository. Congratulations on your contribution! + +11. **Stay Engaged**: Stay engaged with the community, participate in discussions, and consider contributing further. + +Thank you for your interest in contributing to our project! Your contributions help make this project better for everyone. \ No newline at end of file diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..025b67b --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --cov=. --cov-fail-under 80 --cov-report term --cov-report html --maxfail 1 --force-sugar diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..07cfe4f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +ruff==0.4.1 +pytest==8.0.2 +pytest-clarity=1.0.1 +pytest-sugar==1.0.0 +pre-commit==3.6.0 +pytest-cov==5.0.0 diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..bf08de4 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,80 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.8 +target-version = "py311" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[lint.pycodestyle] +ignore-overlong-task-comments = true + + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic"