Skip to content

Commit

Permalink
Increase max line length to 140
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Jul 3, 2023
1 parent 6c546da commit 48c84f9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
max-line-length: "130"
max-line-length: "140"
hadolint:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ prepare:
pylint:
pylint ocw/lib/*.py cleanup_k8s.py

LINE_MAX=140
.PHONY: flake8
flake8:
flake8 --max-line-length=130 webui
flake8 --max-line-length=130 ocw
flake8 --max-line-length=130 manage.py
flake8 --max-line-length=130 cleanup_k8s.py
flake8 --max-line-length=$(LINE_MAX) webui
flake8 --max-line-length=$(LINE_MAX) ocw
flake8 --max-line-length=$(LINE_MAX) manage.py
flake8 --max-line-length=$(LINE_MAX) cleanup_k8s.py

.PHONY: test
test:
Expand Down
5 changes: 3 additions & 2 deletions ocw/lib/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def bs_client(self):
storage_account = PCWConfig.get_feature_property(
'cleanup', 'azure-storage-account-name', self._namespace)
storage_key = self.get_storage_key(storage_account)
connection_string = f"DefaultEndpointsProtocol=https;AccountName={storage_account};AccountKey={storage_key};EndpointSuffix=core.windows.net"
self.__blob_service_client = BlobServiceClient.from_connection_string(connection_string)
self.__blob_service_client = BlobServiceClient.from_connection_string(
f"DefaultEndpointsProtocol=https;AccountName={storage_account};AccountKey={storage_key};EndpointSuffix=core.windows.net"
)
return self.__blob_service_client

def container_client(self, container_name: str):
Expand Down
8 changes: 6 additions & 2 deletions ocw/lib/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def cleanup_snapshots(self, valid_period_days: float) -> None:
if self.dry_run:
self.log_info(f"Snapshot deletion of {snapshot['SnapshotId']} skipped due to dry run mode")
else:
self.log_info(f"Deleting snapshot {snapshot['SnapshotId']} in region {region} with StartTime={snapshot['StartTime']}")
self.log_info(
f"Deleting snapshot {snapshot['SnapshotId']} in region {region} with StartTime={snapshot['StartTime']}"
)
try:
self.ec2_client(region).delete_snapshot(SnapshotId=snapshot['SnapshotId'])
except ClientError as ex:
Expand Down Expand Up @@ -229,7 +231,9 @@ def delete_routing_tables(self, region: str, vpc_id: str) -> None:
for association in route_table['Associations']:
if not association['Main']:
if self.dry_run:
self.log_info(f"{association['RouteTableAssociationId']} disassociation with routing table won't happen due to dry_run mode")
self.log_info(
f"{association['RouteTableAssociationId']} disassociation with routing table won't happen due to dry_run mode"
)
self.log_dbg(association)
else:
self.log_info(f"{association['RouteTableAssociationId']} disassociation with routing table will happen")
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ expected-line-ending-format =
ignore-long-lines = "^\\s*(# )?<?https?://\\S+>?$"
indent-after-paren = 4
indent-string = " "
max-line-length = 130
max-line-length = 140
max-module-lines = 1000
single-line-class-stmt = false
single-line-if-stmt = false
Expand Down

0 comments on commit 48c84f9

Please sign in to comment.