Skip to content
Open
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
1 change: 1 addition & 0 deletions .dev-kit
Submodule .dev-kit added at 646f90
45 changes: 45 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# .editorconfig — Shared editor settings for TaxCloud repos.
#
# Installed by .dev-kit/install.sh as .editorconfig in the repo root.
# Most editors (VS Code, JetBrains, vim, etc.) respect this natively
# or via plugin. See https://editorconfig.org
#
# Like .gitattributes, this is committed and applies to all contributors.

root = true

# Default: 2-space indent, UTF-8, LF, trim trailing whitespace
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
Comment on lines +12 to +18
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 .editorconfig default 2-space indent applies to PHP files, violating .cursorrules 4-space mandate

The .cursorrules file explicitly states under Code Style Guidelines: "Use proper indentation (4 spaces)". The new .editorconfig sets indent_size = 2 as the global default with no [*.php] section to override it. Since the glob [*] matches all files including *.php, editors respecting .editorconfig will auto-format PHP code with 2-space indentation. All existing PHP files in the project (e.g. Model/Tax.php, Model/Api.php) use 4-space indentation per PSR-2. This configuration will actively cause new contributions to use the wrong indentation style.

Prompt for agents
In .editorconfig, add a PHP-specific section after the default [*] block (or after the YAML section) that sets the correct 4-space indentation for PHP files, matching PSR-2 and the .cursorrules requirement:

# PHP: 4-space indent (PSR-2 standard)
[*.php]
indent_size = 4

This should be added somewhere in the file, for example after line 41 (the YAML section) or after line 18 (the default section).
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


# Makefiles require tabs
[Makefile]
indent_style = tab

[*.mk]
indent_style = tab

# Awk: tabs (idiomatic)
[*.awk]
indent_style = tab

# Go: tabs (gofmt standard)
[*.go]
indent_style = tab

# Shell scripts: 4-space indent (Google style, widely adopted)
[*.sh]
indent_size = 4

# YAML: 2-space (standard)
[*.{yml,yaml}]
indent_size = 2

# Markdown: preserve trailing whitespace (line breaks)
[*.md]
trim_trailing_whitespace = false
124 changes: 114 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,114 @@
# Exclude dev/CI files from git archive (GitHub release ZIPs)
.gitignore export-ignore
.gitattributes export-ignore
.github/ export-ignore
.cursorrules export-ignore
Test/ export-ignore
Makefile export-ignore
run-test.sh export-ignore
scripts/ export-ignore
docs/images/ export-ignore
# .gitattributes — Shared line-ending, diff, and merge settings.
#
# Installed by .dev-kit/install.sh as .gitattributes in the repo root.
# Committed to the repo, so these rules apply to all contributors
# regardless of their local git config.
#
# This file makes core.autocrlf largely irrelevant: the rules below
# override it on a per-path basis, which is more precise and portable.

# =============================================================================
# Line Endings
# =============================================================================
# Normalize to LF on commit, use platform-native on checkout.
# This single rule prevents most cross-platform line-ending bugs.
* text=auto

# Force LF for files that break with CRLF (scripts, configs, Makefiles).
# A Windows checkout with CRLF in a shell script is a runtime error.
*.sh text eol=lf
*.bash text eol=lf
*.awk text eol=lf
Makefile text eol=lf
*.mk text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.json text eol=lf
*.toml text eol=lf
Dockerfile text eol=lf
*.dockerfile text eol=lf

# =============================================================================
# Binary Files
# =============================================================================
# Prevent git from applying line-ending conversion or textual merge
# to files that aren't text. Without these rules, git may corrupt
# binaries by "fixing" line endings.

# Images
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.webp binary
*.svg binary

# Fonts
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary
*.eot binary

# Archives
*.zip binary
*.tar binary
*.tar.gz binary
*.tgz binary
*.gz binary

# Documents
*.pdf binary

# Compiled binaries (extensionless)
# Go, Rust, and C projects typically output to bin/ or dist/.
# Mark these directories as binary to prevent line-ending corruption.
bin/** binary
dist/** binary
out/** binary

# Other binary formats that lack common extensions
*.wasm binary
*.pb binary
*.pyc binary
*.so binary
*.dylib binary
*.dll binary
*.exe binary

# =============================================================================
# Better Diffs
# =============================================================================
# Tell git which language driver to use for diff hunk headers.
# Instead of showing the nearest line, git shows the enclosing
# function/class name — much easier to orient yourself in a diff.
*.go diff=golang
*.py diff=python
*.rb diff=ruby
*.html diff=html
*.htm diff=html
*.css diff=css
*.md diff=markdown
*.markdown diff=markdown

# =============================================================================
# Lock Files
# =============================================================================
# Generated lock files produce huge, unreadable diffs. Suppress the
# diff output (they still show as changed, just without the noise).
package-lock.json -diff
yarn.lock -diff
pnpm-lock.yaml -diff
go.sum -diff
Cargo.lock -diff
Gemfile.lock -diff
poetry.lock -diff
composer.lock -diff

# Merge strategy: lock files should be regenerated, not merged.
# "ours" keeps the current branch's version; the developer then
# re-runs the package manager to reconcile.
package-lock.json merge=ours
yarn.lock merge=ours
pnpm-lock.yaml merge=ours
Comment on lines +105 to +114
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 All export-ignore rules removed from .gitattributes, bloating release archives with dev files

The old .gitattributes excluded development/CI files from git archive (used by GitHub for release ZIPs and Composer for package distribution). The new file completely replaces the old content and drops all export-ignore directives. The previously excluded paths (Test/, .github/, scripts/, Makefile, run-test.sh, .cursorrules, docs/images/) will now be included in release archives. This is especially impactful because this PR also adds a release workflow (release.yml) that creates GitHub releases, and this is a Magento extension distributed via Composer — end users will receive test suites, CI workflows, and build scripts in their vendor/ directory.

Prompt for agents
In .gitattributes, after the existing content (or at the end of the file), add back the export-ignore rules that were present in the original file. These rules exclude dev/CI files from git archive output (GitHub release ZIPs and Composer packages). Add a new section like:

# =============================================================================
# Export Ignore (git archive / release ZIPs)
# =============================================================================
# Exclude dev/CI files from git archive (GitHub release ZIPs, Composer packages).
.gitignore export-ignore
.gitattributes export-ignore
.github/ export-ignore
.cursorrules export-ignore
.dev-kit export-ignore
.gitmodules export-ignore
.editorconfig export-ignore
Test/ export-ignore
Makefile export-ignore
run-test.sh export-ignore
scripts/ export-ignore
docs/images/ export-ignore

Also consider adding the newly introduced files (.dev-kit, .gitmodules, .editorconfig, devin_review_ignored_file_changes.md) to the export-ignore list.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dependabot configuration — generated by .dev-kit/ci/scaffold.sh
# Source: .dev-kit/ci/templates/dependabot.yml
# Keeps GitHub Actions and submodules up to date.

version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions:
patterns: ["*"]

- package-ecosystem: gitsubmodule
directory: /
schedule:
interval: weekly
32 changes: 32 additions & 0 deletions .github/workflows/auto-merge-devkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Auto-merge .dev-kit submodule updates — generated by .dev-kit/ci/scaffold.sh
# Source: .dev-kit/ci/templates/auto-merge-devkit.yml
# Automatically merges Dependabot PRs that bump the .dev-kit submodule
# after CI passes. Requires Dependabot to be configured (see dependabot.yml).

name: Auto-merge .dev-kit

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
name: Auto-merge .dev-kit updates
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest

steps:
- name: Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-merge .dev-kit submodule bumps
if: steps.meta.outputs.dependency-names == '.dev-kit'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# CI workflow — generated by .dev-kit/ci/scaffold.sh
# Source: .dev-kit/ci/templates/ci.yml
# Runs lint, test, and build on every push and pull request.
#
# Relies on standard Make targets from .dev-kit/mk/common.mk.
# Customize behavior by defining _lint, _test, _build in your Makefile.

name: CI

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

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Lint / Test / Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Lint
run: make lint

- name: Test
run: make test

- name: Build
run: make build
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Release workflow — generated by .dev-kit/ci/scaffold.sh
# Source: .dev-kit/ci/templates/release.yml
# Creates a GitHub release when a version tag is pushed.
#
# Tag format: v1.2.3

name: Release

on:
push:
tags: ['v*']

permissions:
contents: write

jobs:
release:
name: Create Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Build
run: make build

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".dev-kit"]
path = .dev-kit
url = git@github.com:FedTax/.dev-kit.git
43 changes: 18 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
.PHONY: test test-local test-unit test-compatibility lint lint-fix help

# Default target
help:
@echo "Available commands:"
@echo " make test - Run all tests using Docker"
@echo " make test-local - Run all tests locally (requires PHP)"
@echo " make test-unit - Run unit tests only"
@echo " make test-compatibility - Run Adobe Commerce 2.4.8-p1 compatibility tests"
@echo " make lint - Run PHP CodeSniffer linting"
@echo " make lint-fix - Auto-fix linting issues where possible"
@echo " make help - Show this help message"

# Run all tests using Docker
test:
include .dev-kit/mk/common.mk

.PHONY: _test _lint test-local test-unit test-compatibility lint-fix

# --------------------------------------------------------------------------
# Standard interface implementations
# --------------------------------------------------------------------------

##@ Testing

_test: ## Run all tests using Docker
@echo "Running all tests with Docker..."
@./run-test.sh

# Run tests locally (requires PHP)
test-local:
test-local: ## Run all tests locally (requires PHP)
@echo "Running all tests locally..."
@vendor/bin/phpunit Test/Unit/ --testdox
@for test_file in Test/Integration/*.php; do \
echo "Running $$test_file..."; \
php "$$test_file"; \
done

# Run unit tests only
test-unit:
test-unit: ## Run unit tests only
@echo "Running unit tests..."
@vendor/bin/phpunit Test/Unit/ --testdox

# Run Adobe Commerce 2.4.8-p1 compatibility tests
test-compatibility:
test-compatibility: ## Run Adobe Commerce 2.4.8-p1 compatibility tests
@echo "Running Adobe Commerce 2.4.8-p1 compatibility tests..."
@php Test/Integration/AdobeCommerce248p1CompatibilityTest.php

# Run PHP CodeSniffer linting
lint:
##@ Code Quality

_lint: ## Run PHP CodeSniffer linting
@echo "Running PHP CodeSniffer..."
@lint_output=$$(phpcs --standard=PSR2 --extensions=php Model/ Observer/ Logger/ Setup/ --ignore=Test/ 2>&1 || true); \
if echo "$$lint_output" | grep -q "FOUND [1-9][0-9]* ERROR"; then \
Expand All @@ -48,7 +42,6 @@ lint:
echo "$$lint_output"; \
fi

# Auto-fix PHP CodeSniffer issues where possible
lint-fix:
lint-fix: ## Auto-fix PHP CodeSniffer issues where possible
@echo "Auto-fixing PHP CodeSniffer issues..."
@phpcbf --standard=PSR2 --extensions=php Model/ Observer/ Logger/ Setup/ --ignore=Test/
Loading