Skip to content

Commit

Permalink
Test 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannis-vm committed Jun 22, 2024
1 parent 14a0345 commit e18604b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/format_and_lint.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Code Formatting and Linting
name: Black Code Formatter

on:
push:
pull_request:

jobs:
format_and_lint:
format:
runs-on: ubuntu-latest

steps:
Expand All @@ -17,34 +17,20 @@ jobs:
with:
python-version: '3.x'

- name: Install Black and Flake8
- name: Install Black
run: |
python -m pip install --upgrade pip
pip install black flake8
pip install black
- name: Run Black
run: black -S .

- name: Check for changes
id: git_status
- name: Commit changes if any
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add .
if git diff-index --quiet HEAD --; then
echo "No changes to commit" > /tmp/git_status_output
else
if ! git diff --exit-code; then
git add .
git commit -m "Format code with Black"
echo "Changes committed" > /tmp/git_status_output
git push
fi
continue-on-error: true

- name: Read git status output
id: read_git_status
run: cat /tmp/git_status_output

- name: Push changes
if: steps.read_git_status.outputs.result != 'No changes to commit'
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions pelicun/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ def load_from_file(filepath: str, log: base.Logger | None = None) -> pd.DataFram
encoding_errors='replace',
)




if log:
log.msg('File successfully opened.', prepend_timestamp=False)

Expand Down

0 comments on commit e18604b

Please sign in to comment.