import .gitattributes from CPython#6939
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.gitattributes:
- Around line 29-31: Remove the unused CPython-specific gitattributes rule
"PC/classicAppCompat.*" from the .gitattributes file; locate the line containing
the literal pattern "PC/classicAppCompat.* binary" and delete it so the file no
longer contains the nonexistent PC/ directory rule.
- Around line 32-40: Remove the erroneous attribute entry
"Lib/test/cjkencodings/* noeol" from .gitattributes; locate
the matching pattern string in the "Text files that should not be subject to eol
conversion" block and delete that single line so only existing test-data
directories (e.g., tokenizedata, decimaltestdata, test_email, xmltestdata)
remain.
- Around line 56-71: Remove or correct .gitattributes entries that reference
files not present in our repo: delete the lines for Lib/idlelib/help.html,
Lib/test/levenshtein_examples.json, and Lib/test/test_stable_abi_ctypes.py; then
verify whether Lib/_opcode_metadata.py, Lib/keyword.py, Lib/token.py and files
under Lib/test/certdata/ are actually produced by our build/generation pipeline
(or exist in source) and if not, remove their "generated" markers; if they are
generated, ensure the generation step emits those files and document/update the
build scripts to match so the attributes stay accurate.
| # Specific binary files | ||
| PC/classicAppCompat.* binary | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check for CPython-specific paths referenced in .gitattributes
echo "=== Checking PC/classicAppCompat.* ==="
fd -g 'classicAppCompat.*' PC/ 2>/dev/null || echo "PC/ directory or classicAppCompat.* not found"
echo ""
echo "=== Listing PC directory contents (if exists) ==="
ls -la PC/ 2>/dev/null || echo "PC/ directory not found"
echo ""
echo "=== Checking if PC directory exists ==="
if [ -d "PC" ]; then
echo "PC/ directory exists"
find PC -type f | head -20
else
echo "PC/ directory does not exist"
fiRepository: RustPython/RustPython
Length of output: 294
Remove the unused PC/classicAppCompat.* rule from .gitattributes.
The PC/ directory does not exist in the RustPython repository. This CPython-specific rule will never match any files and should be removed to avoid unnecessary clutter and confusion when maintaining the repository.
🤖 Prompt for AI Agents
In @.gitattributes around lines 29 - 31, Remove the unused CPython-specific
gitattributes rule "PC/classicAppCompat.*" from the .gitattributes file; locate
the line containing the literal pattern "PC/classicAppCompat.* binary" and
delete it so the file no longer contains the nonexistent PC/ directory rule.
| # Text files that should not be subject to eol conversion | ||
| [attr]noeol -text | ||
|
|
||
| Lib/test/cjkencodings/* noeol | ||
| Lib/test/tokenizedata/coding20731.py noeol | ||
| Lib/test/decimaltestdata/*.decTest noeol | ||
| Lib/test/test_email/data/*.txt noeol | ||
| Lib/test/xmltestdata/* noeol | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if CPython test data paths exist in RustPython
echo "=== Checking for test data directories ==="
for dir in "cjkencodings" "tokenizedata" "decimaltestdata" "test_email" "xmltestdata"; do
if [ -d "Lib/test/$dir" ]; then
echo "✓ Lib/test/$dir exists"
else
echo "✗ Lib/test/$dir not found"
fi
done
echo -e "\n=== Checking specific file ==="
if [ -f "Lib/test/tokenizedata/coding20731.py" ]; then
echo "✓ Lib/test/tokenizedata/coding20731.py exists"
else
echo "✗ Lib/test/tokenizedata/coding20731.py not found"
fi
echo -e "\n=== Listing Lib/test subdirectories ==="
ls -d Lib/test/*/ 2>/dev/null | head -15Repository: RustPython/RustPython
Length of output: 708
Remove the non-existent Lib/test/cjkencodings/ path from .gitattributes (line 35).
The directory Lib/test/cjkencodings/ does not exist in RustPython's repository, unlike the other test data directories referenced in this section (tokenizedata, decimaltestdata, test_email, xmltestdata). Remove this line to keep the configuration accurate.
🤖 Prompt for AI Agents
In @.gitattributes around lines 32 - 40, Remove the erroneous attribute entry
"Lib/test/cjkencodings/* noeol" from .gitattributes; locate
the matching pattern string in the "Text files that should not be subject to eol
conversion" block and delete that single line so only existing test-data
directories (e.g., tokenizedata, decimaltestdata, test_email, xmltestdata)
remain.
| # Generated files | ||
| # https://github.com/github/linguist/blob/master/docs/overrides.md | ||
| # | ||
| # To always hide generated files in local diffs, mark them as binary: | ||
| # $ git config diff.generated.binary true | ||
| # | ||
| [attr]generated linguist-generated=true diff=generated | ||
|
|
||
| Lib/_opcode_metadata.py generated | ||
| Lib/keyword.py generated | ||
| Lib/idlelib/help.html generated | ||
| Lib/test/certdata/*.pem generated | ||
| Lib/test/certdata/*.0 generated | ||
| Lib/test/levenshtein_examples.json generated | ||
| Lib/test/test_stable_abi_ctypes.py generated | ||
| Lib/token.py generated |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if the listed files exist in RustPython
echo "=== Checking individual generated Python files ==="
for file in Lib/_opcode_metadata.py Lib/keyword.py Lib/token.py; do
if test -f "$file"; then
echo "✓ $file exists ($(wc -l < "$file") lines)"
else
echo "✗ $file not found"
fi
done
echo -e "\n=== Checking IDLE help ==="
if test -f Lib/idlelib/help.html; then
echo "✓ Lib/idlelib/help.html exists"
else
echo "✗ Lib/idlelib/help.html not found"
fi
echo -e "\n=== Checking test data directory ==="
if test -d Lib/test/certdata; then
file_count=$(find Lib/test/certdata -type f 2>/dev/null | wc -l)
echo "✓ Lib/test/certdata/ exists with $file_count files"
else
echo "✗ Lib/test/certdata/ not found"
fi
echo -e "\n=== Checking levenshtein and stable ABI test files ==="
for file in Lib/test/levenshtein_examples.json Lib/test/test_stable_abi_ctypes.py; do
if test -f "$file"; then
echo "✓ $file exists"
else
echo "✗ $file not found"
fi
done
echo -e "\n=== Checking repository structure ==="
echo "Repository root structure:"
ls -la | grep -E "^d" | head -20Repository: RustPython/RustPython
Length of output: 1805
🏁 Script executed:
#!/bin/bash
# Check if these files are referenced in build configs or if they're CPython-specific
echo "=== Searching for help.html references ==="
rg "help\.html" --type py --type rust --type toml --type md 2>/dev/null | head -20
echo -e "\n=== Searching for levenshtein_examples references ==="
rg "levenshtein_examples" --type py --type rust --type toml 2>/dev/null | head -20
echo -e "\n=== Searching for test_stable_abi_ctypes references ==="
rg "test_stable_abi_ctypes" --type py --type rust --type toml 2>/dev/null | head -20
echo -e "\n=== Checking if these are CPython standard files ==="
echo "CPython stdlib would have help.html (IDLE help)"
echo "CPython stdlib would have levenshtein_examples.json (test data)"
echo "CPython stdlib would have test_stable_abi_ctypes.py (ctypes stable ABI test)"
echo -e "\n=== Checking .gitattributes history ==="
git log --oneline .gitattributes 2>/dev/null | head -5
echo -e "\n=== Checking if certdata is truly generated ==="
ls -la Lib/test/certdata/ | head -10Repository: RustPython/RustPython
Length of output: 1528
Remove or verify entries for non-existent files marked as generated.
The .gitattributes file was imported from CPython but contains entries for files that don't exist in RustPython: Lib/idlelib/help.html, Lib/test/levenshtein_examples.json, and Lib/test/test_stable_abi_ctypes.py. These should either be removed if they're not needed or added to the repository if they're required. Additionally, verify that Lib/test/certdata/ files and the Python stdlib files (_opcode_metadata.py, keyword.py, token.py) are actually generated during the build process, as marking non-generated files as such can cause confusing diff behavior.
🤖 Prompt for AI Agents
In @.gitattributes around lines 56 - 71, Remove or correct .gitattributes
entries that reference files not present in our repo: delete the lines for
Lib/idlelib/help.html, Lib/test/levenshtein_examples.json, and
Lib/test/test_stable_abi_ctypes.py; then verify whether Lib/_opcode_metadata.py,
Lib/keyword.py, Lib/token.py and files under Lib/test/certdata/ are actually
produced by our build/generation pipeline (or exist in source) and if not,
remove their "generated" markers; if they are generated, ensure the generation
step emits those files and document/update the build scripts to match so the
attributes stay accurate.
ff56783 to
e297b95
Compare
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.