Skip to content
Merged
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
62 changes: 61 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,65 @@ Cargo.lock linguist-generated
vm/src/stdlib/ast/gen.rs linguist-generated -merge
Lib/*.py text working-tree-encoding=UTF-8 eol=LF
**/*.rs text working-tree-encoding=UTF-8 eol=LF
*.pck binary
crates/rustpython_doc_db/src/*.inc.rs linguist-generated=true

# Binary data types
*.aif binary
*.aifc binary
*.aiff binary
*.au binary
*.bmp binary
*.exe binary
*.icns binary
*.gif binary
*.ico binary
*.jpg binary
*.pck binary
*.pdf binary
*.png binary
*.psd binary
*.tar binary
*.wav binary
*.whl binary
*.zip binary

# 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

Comment on lines +29 to +37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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 -15

Repository: 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.

# Shell scripts should have LF even on Windows because of Cygwin
Lib/venv/scripts/common/activate text eol=lf
Lib/venv/scripts/posix/* text eol=lf

# CRLF files
[attr]dos text eol=crlf

# Language aware diff headers
# https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more
# https://gist.github.com/tekin/12500956bd56784728e490d8cef9cb81
*.css diff=css
*.html diff=html
*.py diff=python
*.md diff=markdown

# 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
Comment on lines +53 to +68

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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 -20

Repository: 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 -10

Repository: 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.

Loading