Skip to content
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
35 changes: 35 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Python files
[*.py]
indent_style = space
indent_size = 4
max_line_length = 100

# YAML files
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# JSON files
[*.json]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false

# Makefile
[Makefile]
indent_style = tab
39 changes: 34 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,49 @@ labels: bug
assignees: ''
---

**Describe the bug** A clear and concise description of what the bug is.
# Describe the bug

**To Reproduce** Steps to reproduce the behavior:
A clear and concise description of what the bug is.

# To Reproduce

Steps to reproduce the behavior:

1. Install package '...'
2. Run code '...'
3. See error

**Expected behavior** A clear and concise description of what you expected to happen.
# Expected behavior

A clear and concise description of what you expected to happen.

**Environment:**
# Actual behavior

A clear description of what actually happened.

# Environment:

- OS: [e.g. Ubuntu 22.04, Windows 11]
- Python version: [e.g. 3.10.8]
- Package version: [e.g. 0.1.1]
- Installation method: [e.g. pip, poetry, from source]

# Error message/logs

```
Paste any error messages or logs here
```

# Possible Solution

If you have suggestions on a fix for the bug, please describe it here.

# Additional context

Add any other context about the problem here.

# Checklist

**Additional context** Add any other context about the problem here.
- [ ] I have checked that this issue has not already been reported
- [ ] I have provided all the information needed to understand the bug
- [ ] I have simplified the reproduction steps as much as possible
36 changes: 30 additions & 6 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,43 @@
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: 'enhancement'
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
# Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
# Describe the solution you'd like

A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
# Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
# User experience / example code

How would users interact with this feature? If applicable, provide example code or CLI commands showing how this feature would be used.

```python
# Example code demonstrating how the feature would be used
from my_python_package import new_feature

new_feature.do_something()
```

# Benefits and potential drawbacks

What are the benefits of implementing this feature? Are there any potential drawbacks or challenges you foresee?

# Additional context

Add any other context or screenshots about the feature request here.

# Checklist

- [ ] I have checked that this feature has not already been requested
- [ ] I have considered the scope of this feature and how it fits with the project's goals
- [ ] I have provided clear examples of how the feature would be used
32 changes: 28 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
# Description
# Pull Request

<!-- Describe the changes in this PR -->
## Description
<!-- Provide a detailed description of the changes in this PR -->

# Type of change
## Related Issues
<!-- List any related issues that are addressed by this PR -->
<!-- Use the syntax "Fixes #123" or "Resolves #123" to automatically close the issue when the PR is merged -->

## Type of change
<!-- Please check all that apply by replacing [ ] with [x] -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)
- [ ] Test additions or improvements
- [ ] CI/CD or build system changes

## How Has This Been Tested?
<!-- Please describe the tests that you ran to verify your changes -->
<!-- Include details of your testing environment, tests ran, and the outcomes -->

# Checklist
## Checklist
<!-- Please check all that apply by replacing [ ] with [x] -->

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
Expand All @@ -18,3 +33,12 @@
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have updated the version number as appropriate (for feature/breaking changes)
- [ ] I have added a note to CHANGELOG.md if appropriate

## Screenshots (if applicable)
<!-- Add screenshots or GIFs to demonstrate the changes if applicable -->

## Additional context
<!-- Add any other context about the PR here -->
4 changes: 4 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches: [ "main" ]
workflow_dispatch:

# Add permissions block here
permissions:
contents: write # Needed to update the README.md file

jobs:
coverage:
runs-on: ubuntu-latest
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Dependabot configuration file
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Enable version updates for Python
- package-ecosystem: "pip"
# Look for requirements files in the root directory
directory: "/"
# Check for updates once a week (Monday)
schedule:
interval: "weekly"
day: "monday"
# Group dependencies to consolidate PRs
groups:
dev-dependencies:
patterns:
- "black"
- "isort"
- "ruff"
- "mypy"
- "pytest*"
- "bandit"
- "pre-commit"
production-dependencies:
patterns:
- "*"
exclude-patterns:
- "black"
- "isort"
- "ruff"
- "mypy"
- "pytest*"
- "bandit"
- "pre-commit"
# Maximum number of open PRs
open-pull-requests-limit: 10
# Prefix PR titles
commit-message:
prefix: "deps"
include: "scope"
# Add labels to PRs
labels:
- "dependencies"
- "automerge"
# Allow automatic merging
reviewers:
- "DiogoRibeiro7"
assignees:
- "DiogoRibeiro7"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
commit-message:
prefix: "ci"
include: "scope"
labels:
- "dependencies"
- "github_actions"
- "automerge"
reviewers:
- "DiogoRibeiro7"
assignees:
- "DiogoRibeiro7"
109 changes: 109 additions & 0 deletions .github/workflows/docstring-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Docstring Coverage

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
docstring-coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check docstring coverage
run: |
python scripts/check_docstring_coverage.py --min-coverage 80
- name: Generate docstring coverage badge
run: |
python -c "
import re
import subprocess
import json
# Run the docstring coverage script and capture output
result = subprocess.run(
['python', 'scripts/check_docstring_coverage.py', '--dir', 'src'],
capture_output=True,
text=True
)
# Extract the overall coverage percentage
match = re.search(r'Overall docstring coverage: (\d+\.\d+)%', result.stdout)
if match:
coverage = float(match.group(1))
# Determine badge color
color = 'red'
if coverage >= 90:
color = 'brightgreen'
elif coverage >= 80:
color = 'green'
elif coverage >= 70:
color = 'yellowgreen'
elif coverage >= 60:
color = 'yellow'
elif coverage >= 50:
color = 'orange'
# Create badge URL
badge_url = f'https://img.shields.io/badge/docstring%20coverage-{coverage:.1f}%25-{color}'
# Update README.md
with open('README.md', 'r') as f:
readme = f.read()
# Look for existing docstring coverage badge
docstring_badge_pattern = r'!\[Docstring Coverage\]\(https://img\.shields\.io/badge/docstring%20coverage-[\d\.]+%25-[a-z]+\)'
if re.search(docstring_badge_pattern, readme):
# Replace existing badge
readme = re.sub(docstring_badge_pattern, f'![Docstring Coverage]({badge_url})', readme)
else:
# Look for badge section to add to
badge_section = re.search(r'(!\[[^\]]+\]\([^\)]+\)[ \t]*)+', readme)
if badge_section:
# Add to existing badges
end_pos = badge_section.end()
readme = readme[:end_pos] + f' ![Docstring Coverage]({badge_url})' + readme[end_pos:]
else:
# Add after first line
first_line_end = readme.find('\\n')
if first_line_end != -1:
readme = readme[:first_line_end+1] + f'\\n![Docstring Coverage]({badge_url})\\n' + readme[first_line_end+1:]
else:
readme = readme + f'\\n\\n![Docstring Coverage]({badge_url})\\n'
with open('README.md', 'w') as f:
f.write(readme)
print(f'Updated README.md with docstring coverage badge: {coverage:.1f}%')
else:
print('Could not extract docstring coverage percentage')
"
- name: Commit updated README with docstring coverage badge
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git diff --quiet && git diff --staged --quiet || (
git commit -m "docs: update docstring coverage badge [skip ci]"
git push
)
permissions:
contents: write
Loading
Loading