-
Notifications
You must be signed in to change notification settings - Fork 1
Toolchain improv #21
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
Merged
Merged
Toolchain improv #21
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4ffb2e0
updated github actions
pradyumna17 bd69dd1
Added format config files
pradyumna17 b81c98c
Added local vscode settings
pradyumna17 74a4120
Updated README
pradyumna17 301f3b6
Fixed minor error
pradyumna17 2ed1b87
Updated README
pradyumna17 b46e441
Fixed minor bug
pradyumna17 10b4133
Update README
pradyumna17 d411dc9
Changed black formatter to ruff
pradyumna17 66c6452
Update README
pradyumna17 534d404
Updated workflow to include ruff formatter
pradyumna17 500dedd
Fixed typo
pradyumna17 88382f3
Fixed typo
pradyumna17 4621099
Updated formatting
pradyumna17 fdcfeea
Updated github workflows
pradyumna17 3e85157
Minor config update
pradyumna17 e41dc08
Updated formatting
pradyumna17 5db3528
Update README.md
wallscheid 8c12167
Update README.md
pradyumna17 21db862
Updated latexindent rules
pradyumna17 39c264e
Updated the formatting
pradyumna17 11d26aa
Updated the python workflow
pradyumna17 bd8c5ef
Minor bugfix
pradyumna17 b460cb6
Minor format fix
pradyumna17 0012963
Minor bugfix
pradyumna17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: LaTeX + Python CI | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| format-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install latexindent binary | ||
| run: | | ||
| set -e | ||
| curl -L -o latexindent-linux \ | ||
| https://github.com/cmhughes/latexindent.pl/releases/latest/download/latexindent-linux | ||
| chmod +x latexindent-linux | ||
| sudo mv latexindent-linux /usr/local/bin/latexindent | ||
| echo "latexindent installed at:" | ||
| which latexindent || echo "latexindent not found on PATH" | ||
|
|
||
| echo "latexindent verbose version info:" | ||
| latexindent -vv | ||
|
|
||
| - name: Check LaTeX formatting with latexindent (dry-run) | ||
| run: | | ||
| set -e | ||
| for ext in tex sty cls; do | ||
| for file in $(find . -name "*.${ext}" || true); do | ||
| formatted=$(latexindent -l=.latexindent.yml -o=- "$file") | ||
| original=$(cat "$file") | ||
| if [ "$formatted" != "$original" ]; then | ||
| echo "::error file=$file::File is not properly formatted. Please run latexindent locally." | ||
| exit 1 | ||
| fi | ||
| done | ||
| done | ||
| echo "All LaTeX files are properly formatted!" | ||
|
|
||
|
|
||
| - name: Install Python format tools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install ruff | ||
|
|
||
| - name: Check Python + Notebook formatting with Ruff (dry-run) | ||
| run: | | ||
| set -e | ||
| for file in $(find . \( -name "*.py" -o -name "*.ipynb" \) ); do | ||
| if ! ruff format --diff --config=./pyproject.toml "$file"; then | ||
| echo "::error file=$file::File is not properly formatted." | ||
| exit 1 | ||
| fi | ||
| done | ||
| echo "All Python (.py, .ipynb) files are properly formatted!" | ||
|
|
||
| build: | ||
| needs: format-check | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| tex: | ||
| - test/testLecture.tex | ||
| - test/testExercise.tex | ||
| - test/testExam.tex | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Submodule-like setup | ||
| run: | | ||
| mkdir -p ../course_template | ||
| rsync -av --exclude='.git' . ../course_template/ | ||
| mkdir -p ../../course_template | ||
| ln -s "$PWD/theme" ../../course_template/theme || true | ||
| ln -s "$PWD/style" ../../course_template/style || true | ||
|
|
||
| - uses: xu-cheng/latex-action@v3 | ||
| with: | ||
| root_file: ${{ matrix.tex }} | ||
| args: -pdf -interaction=nonstopmode -halt-on-error -shell-escape | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| onlyOneBackUp: 1 | ||
| maxNumberOfBackUps: 1 | ||
| backupExtension: .libak | ||
|
|
||
| defaultIndent: ' ' | ||
pradyumna17 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| lookAtTheseModifyLineBreaks: | ||
| environments: 1 | ||
| commands: 1 | ||
| ifElseFi: 1 | ||
| items: 1 | ||
| specialBeginEnd: 1 | ||
|
|
||
| indentAfterHeadings: | ||
| section: | ||
| indentAfterThisHeading: 1 | ||
| level: 1 | ||
| subsection: | ||
| indentAfterThisHeading: 1 | ||
| level: 2 | ||
| subsubsection: | ||
| indentAfterThisHeading: 1 | ||
| level: 3 | ||
|
|
||
| alignAtAmpersand: | ||
| environments: | ||
| aligned: 1 | ||
| matrix: 1 | ||
| tabular: 1 | ||
| array: 1 | ||
| spacesAfterAmpersand: 1 | ||
|
|
||
| modifyLineBreaks: | ||
| yaml: 1 | ||
| preserveBlankLines: 0 | ||
|
|
||
| noAdditionalIndent: | ||
| comment: 1 | ||
| verbatim: 1 | ||
| lstlisting: 1 | ||
|
|
||
| preamble: | ||
| indentPreamble: 1 | ||
|
|
||
| maximumIndentation: | ||
| environments: 10 | ||
| commands: 10 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "recommendations": [ | ||
| "James-Yu.latex-workshop", | ||
| "charliermarsh.ruff" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "latex-workshop.formatting.latexindent.path": "latexindent", | ||
| "latex-workshop.formatting.latexindent.args": [ | ||
| "-l=%WORKSPACE_FOLDER%/.latexindent.yml", | ||
| "%TMPFILE%", | ||
| "-o=%TMPFILE%" | ||
| ], | ||
| "editor.formatOnSave": true, | ||
| "latex-workshop.formatting.latex": "latexindent", | ||
| "ruff.configuration": "./pyproject.toml", | ||
| "[python]": { | ||
| "editor.formatOnSave": true, | ||
| "editor.codeActionsOnSave": { | ||
| "source.organizeImports": "explicit" | ||
| }, | ||
| "editor.defaultFormatter": "charliermarsh.ruff" | ||
| }, | ||
| "notebook.formatOnSave.enabled": true, | ||
| "notebook.codeActionsOnSave": { | ||
| "notebook.source.organizeImports": "explicit" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.