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
114 changes: 49 additions & 65 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,97 @@ env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Validate JSON
run: |
python3 - <<'EOF'
import json, sys
from pathlib import Path
errors = []
for f in Path("./inventory_tools/inventory_tools/").rglob("*.json"):
try:
json.loads(f.read_text())
except json.JSONDecodeError as e:
errors.append(f"{f}: {e}")
if errors:
print("\n".join(errors))
sys.exit(1)
EOF

- name: Compile
run: python3 -m compileall -q ./

- name: Check merge conflicts
run: |
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"; then
echo "Found merge conflicts"
exit 1
fi

mypy:
needs: [ py_json_merge ]
needs: [validate]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install mypy
run: pip install mypy

- name: Install mypy types
- name: Install mypy stubs
run: mypy ./inventory_tools/. --install-types --non-interactive

- name: Run mypy
uses: sasanquaneuf/mypy-github-action@releases/v1
with:
checkName: 'mypy'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mypy ./inventory_tools/.

black:
needs: [ py_json_merge ]
needs: [validate]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Black (Frappe)
run: pip install git+https://github.com/frappe/black.git

- name: Run Black (Frappe)
- name: Run Black
run: black --check .

prettier:
needs: [ py_json_merge ]
needs: [validate]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 2
- uses: actions/checkout@v4

- name: Prettify code
uses: rutajdash/prettier-cli-action@v1.0.0
- uses: actions/setup-node@v4
with:
config_path: ./.prettierrc.js
ignore_path: ./.prettierignore
node-version: '20'

- name: Prettier Output
if: ${{ failure() }}
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{steps.prettier-run.outputs.prettier_output}}" >> $GITHUB_OUTPUT
- name: Run Prettier
run: npx --yes prettier@3.1.0 --check --config ./.prettierrc.cjs --ignore-path ./.prettierignore "**/*.js" "**/*.vue"

json_diff:
needs: [ py_json_merge ]
needs: [validate]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 2

- name: Find JSON changes
id: changed-json
uses: tj-actions/changed-files@v43
uses: tj-actions/changed-files@v45
with:
files: |
**/*.json
Expand Down Expand Up @@ -138,25 +144,3 @@ jobs:
for file in ${{ steps.changed-json.outputs.deleted_files }}; do
echo "D,${file}" >> base/mrd.txt
done


py_json_merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Fetch validator
run: git clone --depth 1 https://gist.github.com/f1bf2c11f78331b2417189c385022c28.git validate_json

- name: Validate JSON
run: python3 validate_json/validate_json.py ./inventory_tools/inventory_tools/

- name: Compile
run: python3 -m compileall -q ./

- name: Check merge
run: |
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
29 changes: 29 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Static Analysis

on:
push:
branches: ["*"]
pull_request:
branches: ["*"]

permissions:
contents: read

jobs:
static-analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install test_utils with vulture
run: pip install git+https://github.com/agritheory/test_utils.git vulture

- name: Run static analysis
run: static_analysis . --no-hooks --no-frontend --no-python-calls --no-jinja
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repos:
additional_dependencies: ['flake8-bugbear']

- repo: https://github.com/agritheory/test_utils
rev: v1.18.0
rev: v1.20.2
hooks:
- id: update_pre_commit_config
- id: validate_frappe_project
Expand All @@ -63,18 +63,16 @@ repos:
args: ['--directory', '.', '--app', 'inventory_tools', '--base-branch', 'version-15']
- id: check_code_duplication
args: ['--max-clones', '60', '--max-percentage', '5.0']
- id: static_analysis
args: ['.']

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
args: ['--config', '.prettierrc.cjs', '--ignore-path', '.prettierignore']
types_or: [javascript, vue, scss]
exclude: |
(?x)^(
.*node_modules.*|
inventory_tools/public/dist/.*|
inventory_tools/public/js/lib/.*
)$
exclude: 'inventory_tools/public/js/lib/.*'

ci:
autoupdate_schedule: weekly
Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/alternate_workstation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Alternative Workstation Functionality

<div class="byline">
Rohan Bansal, coleandreoli, IshwaryaM1030, Tyler Matteson, and Francisco Roldán 2026-02-21
Rohan Bansal, coleandreoli, IshwaryaM1030, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/cartonization.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Cartonization Configuration & Validation Guide

<div class="byline">
Ishwarya 2026-01-26
IshwaryaM1030 and Tyler Matteson 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/exampledata.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Using the Example Data to Experiment with Inventory Tools

<div class="byline">
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-21
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/faceted_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ For license information, please see license.txt-->
# Faceted Search

<div class="byline">
Rohan Bansal, Devarsh Bhatt, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-21
Rohan Bansal, Devarsh Bhatt, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Inventory Tools Documentation

<div class="byline">
Rohan Bansal, Devarsh Bhatt, coleandreoli, Ishwarya, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-01-26
Rohan Bansal, Devarsh Bhatt, coleandreoli, IshwaryaM1030, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/landed_costing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Inline Landed Costing

<div class="byline">
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-21
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/manufacturing_capacity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Manufacturing Capacity Report

<div class="byline">
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-21
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/material_demand.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Material Demand

<div class="byline">
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-21
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/multi_company_sales_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Multi-Company Sales Order

<div class="byline">
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
Tyler Matteson 2026-02-22
</div>


Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/docs/overproduction_allowance.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For license information, please see license.txt-->
# Overproduction Allowance

<div class="byline">
Rohan Bansal, coleandreoli, Heather Kusmierz, Tyler Matteson, and Francisco Roldán 2026-02-22
Tyler Matteson 2026-02-22
</div>


Expand Down
Loading
Loading