Skip to content

Commit

Permalink
add pylint and flake
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Dec 3, 2024
1 parent 89df8b6 commit 0834f34
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
# Ignore specific warnings or errors.
ignore = E501

# Optionally, increase the max line length (if you prefer to set a limit instead of ignoring entirely).
max-line-length = 120

# Exclude specific files or directories.
exclude = tests/, docs/, .venv/

7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ jobs:
poetry build
poetry install
- name: Run pytest
run: poetry run pytest
- name: Run Tests
run:|
poetry run flake8 podaac
poetry run pylint podaac
poetry run pytest

# First job in the workflow installs and verifies the software
deploy_sit:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ jobs:
poetry build
poetry install
- name: Run pytest
run: poetry run pytest
- name: Run Tests
run:|
poetry run flake8 podaac
poetry run pylint podaac
poetry run pytest
20 changes: 20 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[MASTER]
# List of directories to ignore (relative to the current directory).
ignore=tests

[MESSAGES CONTROL]
# Disable the following messages by symbolic name or ID.
disable=line-too-long, # C0301: Line too long
broad-exception-caught, # W0718: Catching too general exception Exception
unspecified-encoding, # W1514: Using open without explicitly specifying an encoding
redefined-argument-from-local, # R1704: Redefining argument with a local name
no-value-for-parameter # E1120: No value for argument in function call

[FORMAT]
# Maximum allowed line length (optional override if you want to enforce a slightly longer limit).
max-line-length=120

[REPORTS]
# Disable the output of the report summary.
reports=no

7 changes: 7 additions & 0 deletions podaac/podaac_forge_tig_config_generator/generate_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""script used to generate forge tig configuration"""

import ast
import json
import os
Expand All @@ -7,7 +9,10 @@
import pandas as pd
from jsonschema import validate


class HiTideConfigGenerator:
"""Class to generate configurations"""

REQUIRED_SETTINGS_SHEET = "required-settings"
FORGE_PY_SHEET = "forge-py"
TIG_SHEET = "tig"
Expand Down Expand Up @@ -126,6 +131,7 @@ def load_schema() -> Dict[str, Any]:
with open(schema_path, "r") as file:
return json.load(file)


@click.command()
@click.option('-f', '--file', help='Excel file with configuration settings', required=True)
def generate_hitide_config(file: str):
Expand All @@ -149,5 +155,6 @@ def generate_hitide_config(file: str):
except Exception as e:
click.echo(f"Validation error: {e}", err=True)


if __name__ == '__main__':
generate_hitide_config()
163 changes: 161 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jsonschema = "^4.23.0"
pandas = "^2.2.3"
openpyxl = "^3.1.5"
click = "^8.1"
pylint = "^3.3.2"
flake8 = "^7.1.1"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 0834f34

Please sign in to comment.