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

chore: add backport config and added codespell pre-commit #109

Merged
merged 6 commits into from
Aug 13, 2024
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
26 changes: 26 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ repos:
- id: flake8
additional_dependencies: ['flake8-bugbear']

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli

- repo: https://github.com/agritheory/test_utils
rev: v0.15.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ locale
*.egg-info
dist/
# build/
cloud_storage/docs/current
cloud_storage/public/dist
inventory_tools/docs/current
inventory_tools/public/dist
.vscode
.vs
node_modules
Expand Down
4 changes: 2 additions & 2 deletions inventory_tools/inventory_tools/overrides/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def make_sales_invoices(docname: str, rows: list | str) -> None:
@frappe.whitelist()
def get_item_details(args, doc=None, for_validate=False, overwrite_warehouse=True):
"""
HASH: 334c4d06766b67a4e35b4ec4fe99a9d8dc07691a
HASH: 59b9b7dc9185fee1814d5ef7d89d0875fead4bf7
REPO: https://github.com/frappe/erpnext/
PATH: erpnext/stock/get_item_details.py
METHOD: get_item_details
Expand All @@ -243,7 +243,7 @@ def get_item_details(args, doc=None, for_validate=False, overwrite_warehouse=Tru
@frappe.whitelist()
def validate_item_details(args, item):
"""
HASH: 334c4d06766b67a4e35b4ec4fe99a9d8dc07691a
HASH: 59b9b7dc9185fee1814d5ef7d89d0875fead4bf7
REPO: https://github.com/frappe/erpnext/
PATH: erpnext/stock/get_item_details.py
METHOD: validate_item_details
Expand Down
55 changes: 4 additions & 51 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ mypy = "^1.10.0"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.codespell]
MyuddinKhatri marked this conversation as resolved.
Show resolved Hide resolved
skip = "CHANGELOG.md"

[tool.pytest.ini_options]
addopts = "-s --disable-warnings" #--cov=inventory_tools --cov-report term-missing"

Expand All @@ -34,57 +37,7 @@ ensure_newline_before_comments = true
indent = "\t"

[tool.semantic_release]
assets = []
commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
commit_parser = "angular"
logging_use_named_masks = false
major_on_zero = true
tag_format = "v{version}"
version_variables = [
"inventory_tools/__init__.py:__version__",
"pyproject.toml:version"
]
version_toml = ["pyproject.toml:tool.poetry.version"]

[tool.semantic_release.branches.version]
match = "version-(14|15)"
prerelease = false

[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = []

[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
comment_start_string = "{#"
comment_end_string = "#}"
trim_blocks = false
lstrip_blocks = false
newline_sequence = "\n"
keep_trailing_newline = false
extensions = []
autoescape = true

[tool.semantic_release.commit_author]
env = "GIT_COMMIT_AUTHOR"
default = "semantic-release <semantic-release>"

[tool.semantic_release.commit_parser_options]
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]

[tool.semantic_release.remote]
name = "origin"
type = "github"
ignore_token_for_push = false

[tool.semantic_release.remote.token]
env = "GH_TOKEN"

[tool.semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true
Loading