Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert three spaces to two #1

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

garland-culbreth
Copy link

Changes

Find and replace all occurrences of 3-space indentation with 2-space. This also applies to xrst/rst docstrings and comments.

The regex I used to match 3-spaces was: ^((( {2})(?: {1}))(\b|(?!=[,'";\.:\*\\\/\{\}\[\]\(\)])))

Checks

pytest

❯ pytest
============================== test session starts ==============================
platform darwin -- Python 3.12.7, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/gculbr/repos/xrst_gc
configfile: pyproject.toml
collected 1 item                                                                                                                                                   

pytest/test_rst.py .                                                       [100%]

============================== 1 passed in 1.65s ================================

bin/check_xrst.sh

❯ bin/run_xrst.sh 
python -m xrst --local_toc --html_theme sphinx_rtd_theme --index_page_name user-guide --group_list default user dev --number_jobs 8 --target html
Using following input_files: bin/input_files.sh
sphinx-build -b html -j 8 build/rst build/html
rm -r build/html/_sources
cp -r build/rst/_sources build/html/_sources
xrst: OK
run_xrst.sh: OK

convert all occurrences of 3 leading spaces to 2, except where the form
the hanging indent of an ennumerated list or are required by syntax.
format all examples/ files with two space indentation.
cleaned up a few places where the indentation replacement had replaced
only the first match.
@garland-culbreth
Copy link
Author

garland-culbreth commented Feb 19, 2025

On the subject of formatting, I think it would be good to use a purpose-built formatter that adheres to the standard python formatting rules, PEP8 etc., such as ruff or black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant