Lint Python twice: 1. Whole repo, 2. Exclude tests/ (#1035)

* Lint Python twice: 1. Whole repo, 2. Exclude tests/

Both runs take less than a second so...
`line-length=366` is more reasonable`
```
    - run: pip install --user ruff  # Lint Python twice: 1. Whole repo, 2. Exclude tests/
    - run: ruff --format=github --line-length=7228 --target-version=py39
                --ignore=E402,E712,E721,E722,E741,F401,F403,F405,F541,F601,F811,F822,F841 .
    - run: ruff --format=github --line-length=366 --target-version=py39
                --exclude=tests/ --ignore=E402,E712,E722,E741,F401,F403,F405,F541,F822,F841 .
```

* Update configoptions.py
This commit is contained in:
Christian Clauss
2023-04-07 17:14:51 +02:00
committed by GitHub
parent 1b16a39cef
commit 1a3b4c2afe
3 changed files with 6 additions and 4 deletions

View File

@@ -7,9 +7,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: pip install --user ruff - run: pip install --user ruff # Lint Python twice: 1. Whole repo, 2. Exclude tests/
- run: ruff --format=github --line-length=7228 --target-version=py39 - run: ruff --format=github --line-length=7228 --target-version=py39
--ignore=E402,E712,E721,E722,E741,F401,F403,F405,F541,F601,F811,F821,F822,F841 . --ignore=E402,E712,E721,E722,E741,F401,F403,F405,F541,F601,F811,F822,F841 .
- run: ruff --format=github --line-length=366 --target-version=py39
--exclude=tests/ --ignore=E402,E722,E741,F401,F403,F405,F541,F822,F841 .
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]')" if: "!contains(github.event.head_commit.message, '[skip ci]')"

View File

@@ -164,7 +164,7 @@ See also `osxphotos help timewarp` for more information on the timewarp
command which can be used to change the time zone of photos after import. command which can be used to change the time zone of photos after import.
""" """ # noqa: E501
), ),
width=formatter.width, width=formatter.width,
markdown=True, markdown=True,

View File

@@ -50,7 +50,7 @@ class ConfigOptions:
try: try:
arg = args[attr] arg = args[attr]
# don't test 'not arg'; need to handle empty strings as valid values # don't test 'not arg'; need to handle empty strings as valid values
if arg is None or arg == False: if arg is None or arg is False:
if type(self._attrs[attr]) == tuple: if type(self._attrs[attr]) == tuple:
setattr(self, attr, ()) setattr(self, attr, ())
else: else: