Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Fix linting #179

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
command: ./scripts/check_versions.sh
- run:
name: Lint
command: poetry run pylint starknet_devnet test
command: ./scripts/lint.sh
- run:
name: Compile test contracts
command: ./scripts/compile_contracts.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,13 @@ poetry run starknet-devnet
### Development - Run in debug mode

```text
./scripts/starknet-devnet-debug.sh
./scripts/starknet_devnet_debug.sh
```

### Development - Lint

```text
poetry run pylint starknet_devnet test
./scripts/lint.sh
```

### Development - Test
Expand Down
5 changes: 5 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e

poetry run pylint $(git ls-files '*.py')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart solution

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, john is really smart, had to scroll all the way to the third answer: https://stackoverflow.com/a/63044665

6 changes: 4 additions & 2 deletions test/support/assertions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Utilities for schema validation"""

import json
from os.path import join, dirname, abspath
from os.path import join, dirname
from jsonschema import validate, RefResolver


Expand All @@ -18,5 +20,5 @@ def _load_json_schema(filename):
relative_path = join("schemas", filename)
absolute_path = join(dirname(__file__), relative_path)

with open(absolute_path) as schema_file:
with open(absolute_path, encoding="utf-8") as schema_file:
return json.loads(schema_file.read())