Skip to content

Commit

Permalink
refactor openssa.utils.cli.contrib.ssa_prob_solver
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVinhLuong102 committed Jan 15, 2024
1 parent 53f345d commit 0d5e075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ignore = [
"D107", # missing docstring in `__init__`
"D200", # one-line docstring should fit on one line
"D202", # no blank lines allowed after function docstring
"D203", # one blank line before class
"D204", # 1 blank line required after class docstring
"D205", # 1 blank line required between summary line and description
"D212", # multi-line docstring summary should start at the first line
Expand All @@ -66,6 +67,7 @@ ignore = [
"EM102", # exception must not use an f-string literal, assign to variable first
"ERA001", # found commented-out code
"F401", # imported but unused
"FA102", # missing `from __future__ import annotations`, but uses PEP 604 union
"FBT001", # boolean-typed positional argument in function definition
"FBT002", # boolean default positional argument in function definition
"FBT003", # boolean positional value in function call
Expand Down Expand Up @@ -109,6 +111,7 @@ ignore = [
"S101", # use of `assert` detected
"S106", # possible hardcoded password assigned to argument
"S605", # starting a process with a shell, possible injection detected
"S607", # starting a process with a partial executable path
"SIM102", # use a single `if` statement instead of nested `if` statements
"SIM108", # use ternary operator `temp = temp["content"] if isinstance(temp, dict) else temp.content` instead of `if`-`else`-block
"SIM112", # use capitalized environment variable
Expand All @@ -123,5 +126,4 @@ ignore = [
"UP007", # use `X | Y` for type annotations
"UP035", # `typing.[X]` is deprecated, use `[x]` instead
"UP039", # unnecessary parentheses after class definition
"D203", # one-blank-line-before-class
]
8 changes: 3 additions & 5 deletions openssa/utils/cli/contrib/ssa_prob_solver.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
"""OpenSSA Contrib SSA Problem Solver CLI."""


from collections.abc import Sequence
import os
from pathlib import Path

import click


__all__: Sequence[str] = ('openssa_contrib_ssa_prob_solver_cli',)


@click.command(name='solver',
cls=click.Command,
context_settings=None,
Expand All @@ -23,4 +20,5 @@
def openssa_contrib_ssa_prob_solver_cli():
"""Launch StreamlitSSAProbSolver."""
from openssa.contrib.streamlit_ssa_prob_solver import __path__ # pylint: disable=import-outside-toplevel
os.system(f'streamlit run {__path__[0]}/main.py --server.allowRunOnSave=true --server.runOnSave=true')
os.chdir(Path(__path__[0]))
os.system('streamlit run main.py --server.allowRunOnSave=true --server.runOnSave=true')

0 comments on commit 0d5e075

Please sign in to comment.