Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
47c4b6d
Initial plan
Copilot Dec 18, 2025
03625fe
Make pre-commit installation consistent between bash and Windows scripts
Copilot Dec 18, 2025
89c81e1
Improve pre-commit check to include pip package verification
Copilot Dec 18, 2025
8463fae
Fix variable comparison syntax in Windows script
Copilot Dec 18, 2025
9d4228d
Pin pre-commit version in requirements-dev.txt for supply-chain security
Copilot Dec 18, 2025
6fb9719
Merge pull request #54 from Refactron-ai/copilot/sub-pr-53
omsherikar Dec 22, 2025
743ee4d
Initial plan
Copilot Dec 28, 2025
0bddf34
Fix setup_dev.sh to install pre-commit from requirements-dev.txt
Copilot Dec 28, 2025
301def7
Update info message to mention both documentation and pre-commit depe…
Copilot Dec 28, 2025
6db07cf
Improve error message for missing pre-commit installation
Copilot Dec 28, 2025
1648274
Merge pull request #57 from Refactron-ai/copilot/sub-pr-56
omsherikar Dec 28, 2025
c03dcd8
Initial plan
Copilot Dec 28, 2025
91bbf73
Fix pre-commit version to support Python 3.8-3.9
Copilot Dec 28, 2025
e452a67
Remove accidentally committed wheel file and update .gitignore
Copilot Dec 28, 2025
5557921
Merge pull request #58 from Refactron-ai/copilot/sub-pr-56-again
omsherikar Dec 30, 2025
77b74cf
Initial plan
Copilot Dec 30, 2025
15310ce
Fix pre-commit version to support Python 3.8-3.9
Copilot Dec 30, 2025
b8042d2
Merge pull request #59 from Refactron-ai/copilot/sub-pr-56-another-one
omsherikar Dec 30, 2025
e885423
Revert "Fix pre-commit version constraint for Python 3.8-3.9 compatib…
omsherikar Dec 30, 2025
61efc92
Merge pull request #62 from Refactron-ai/revert-59-copilot/sub-pr-56-…
omsherikar Dec 30, 2025
21f5beb
Update requirements-dev.txt
omsherikar Dec 30, 2025
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ parts/
sdist/
var/
wheels/
*.whl
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ git push origin feature/my-improvement
```bash
# Format with black
black refactron tests

# Sort imports
isort refactron tests
```
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ black>=23.0.0
mypy>=1.0.0
flake8>=6.0.0
isort>=5.12.0
pre-commit==4.0.1

# Documentation
sphinx>=7.0.0
Expand Down
6 changes: 0 additions & 6 deletions setup_dev.bat
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ if exist "requirements-dev.txt" (
REM Install pre-commit hooks
echo.
echo πŸ”§ Setting up pre-commit hooks...
python -m pip install pre-commit --quiet
if errorlevel 1 (
echo ❌ Error: Failed to install pre-commit
exit /b 1
)
pre-commit install
if errorlevel 1 (
echo ❌ Error: Failed to install pre-commit hooks
Expand Down Expand Up @@ -125,4 +120,3 @@ echo venv\Scripts\activate
echo.
echo Happy coding! πŸš€
pause

27 changes: 13 additions & 14 deletions setup_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,33 @@ pip install -e ".[dev]" --quiet
# - Core development tools (pytest, black, mypy, flake8, isort, etc.) are installed
# via the [dev] extra in pyproject.toml (see the pip install -e ".[dev]" above).
# - To avoid redundant installations and version conflicts, we only use
# requirements-dev.txt for *extra* tools such as documentation dependencies.
# requirements-dev.txt for *extra* tools such as documentation dependencies and pre-commit.
if [ -f "requirements-dev.txt" ]; then
echo "πŸ“₯ Installing additional documentation/development dependencies from requirements-dev.txt..."

# Extract Sphinx-related requirements (e.g., sphinx, sphinx-rtd-theme) from
# requirements-dev.txt and install only those. This avoids re-installing tools
# that are already provided by the [dev] extra.
DOC_REQUIREMENTS=$(grep -E '^[[:space:]]*sphinx' requirements-dev.txt || true)
# Extract Sphinx-related and pre-commit requirements from requirements-dev.txt.
# This avoids re-installing tools that are already provided by the [dev] extra.
EXTRA_REQUIREMENTS=$(grep -E '^[[:space:]]*(sphinx|pre-commit)' requirements-dev.txt || true)

if [ -n "$DOC_REQUIREMENTS" ]; then
echo "$DOC_REQUIREMENTS" | xargs -n1 pip install --quiet
if [ -n "$EXTRA_REQUIREMENTS" ]; then
echo "$EXTRA_REQUIREMENTS" | xargs -n1 pip install --quiet
else
echo "ℹ️ No additional documentation dependencies detected in requirements-dev.txt; skipping."
echo "ℹ️ No additional documentation or pre-commit dependencies detected in requirements-dev.txt; skipping."
fi
fi

# Install pre-commit hooks
echo ""
echo "πŸ”§ Setting up pre-commit hooks..."
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The pre-commit command will fail on Unix/Linux systems because pre-commit is not being installed. The setup_dev.sh script only installs sphinx-related dependencies from requirements-dev.txt (see lines 64-68 which use grep to filter only sphinx packages), so adding pre-commit to requirements-dev.txt won't actually install it. You need to either:

  1. Add pre-commit to the [dev] optional dependencies in pyproject.toml, or
  2. Update the grep filter in setup_dev.sh to also include pre-commit packages, or
  3. Explicitly install pre-commit before calling pre-commit install
Suggested change
echo "πŸ”§ Setting up pre-commit hooks..."
echo "πŸ”§ Setting up pre-commit hooks..."
echo "πŸ“₯ Ensuring pre-commit is installed..."
if ! command -v pre-commit >/dev/null 2>&1; then
pip install pre-commit --quiet
fi

Copilot uses AI. Check for mistakes.
if command -v pre-commit &> /dev/null || pip show pre-commit &> /dev/null; then
if command -v pre-commit &> /dev/null; then
pre-commit install
echo "βœ… Pre-commit hooks installed"
else
echo "⚠️ pre-commit not found. Installing..."
pip install pre-commit --quiet
pre-commit install
echo "βœ… Pre-commit hooks installed"
echo "❌ Error: pre-commit is not installed in this environment."
echo "This should have been installed from requirements-dev.txt."
echo "Please ensure pre-commit is listed in requirements-dev.txt or install it manually:"
echo " pip install pre-commit"
exit 1
fi

# Verify installation
Expand Down Expand Up @@ -132,4 +132,3 @@ echo "πŸ’‘ To activate the environment in the future, run:"
echo " source venv/bin/activate"
echo ""
echo "Happy coding! πŸš€"

Loading