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

Flake8 linter fixes + updating PR lint rules #1130

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r linters-requirements.txt
- name: Lint using built-in script
run: bash shell/lint.sh
- name: Lint with OpenFL-specific rules
run: bash shell/lint.sh
8 changes: 3 additions & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
- name: Install linters
run: |
python -m pip install --upgrade pip
pip install -r linters-requirements.txt
pip install .
- name: Lint with flake8
run: |
flake8 --show-source
- name: Lint with OpenFL-specific rules
run: bash shell/lint.sh
teoparvanov marked this conversation as resolved.
Show resolved Hide resolved

pytest-coverage: # from pytest_coverage.yml
needs: lint
Expand Down
6 changes: 3 additions & 3 deletions openfl-workspace/keras_cnn_mnist/src/tfmnist_inmemory.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def __init__(self, data_path, batch_size, **kwargs):
# collaborator list.
try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def __init__(self, data_path, batch_size, **kwargs):
# collaborator list.
try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
6 changes: 3 additions & 3 deletions openfl-workspace/torch_cnn_histology/src/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def __init__(self, data_path, batch_size, **kwargs):

try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
6 changes: 3 additions & 3 deletions openfl-workspace/torch_cnn_mnist/src/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def __init__(self, data_path, batch_size, **kwargs):

try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def __init__(self, data_path, batch_size, **kwargs):

try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def __init__(self, data_path, batch_size, **kwargs):

try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def __init__(self, data_path, batch_size, **kwargs):
# of collaborator list.
try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
6 changes: 3 additions & 3 deletions openfl-workspace/torch_unet_kvasir/src/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ def __init__(self, data_path, batch_size, **kwargs):

try:
int(data_path)
except:
except ValueError:
raise ValueError(
"Expected `%s` to be representable as `int`, as it refers to the data shard " +
"number used by the collaborator.",
"Expected `%s` to be representable as `int`, as it refers to the data shard "
+ "number used by the collaborator.",
data_path
)

Expand Down
Loading