Skip to content

Commit

Permalink
VS Code setup, add simple_salesforce
Browse files Browse the repository at this point in the history
  • Loading branch information
jlantz committed Nov 2, 2024
1 parent fdcd7b6 commit a44852c
Show file tree
Hide file tree
Showing 6 changed files with 366 additions and 12 deletions.
Binary file modified .coverage
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ __pycache__/
*.pyc
.DS_Store
.swp
site
coverage.xml
21 changes: 19 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
{
"python.testing.pytestArgs": [
"tests"
"tests",
"--cov",
"--cov-report=xml"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"coverage-gutters.coverageFileNames": [
"coverage.xml",
"coverage.json"
],
// Enable linting with flake8
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
// Enable formatting with black
"python.formatting.provider": "black",
"editor.formatOnSave": true,
// Specify the Python interpreter path
"python.pythonPath": "${workspaceFolder}/venv/bin/python",
// IntelliSense settings
"python.analysis.autoImportCompletions": true,
"python.languageServer": "Pylance"
}
31 changes: 25 additions & 6 deletions d2x/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# cli.py
import rich_click as click
from d2x.models.sf.auth import LoginUrlModel, SfdxAuthUrlModel
import sys
import pdb
from d2x.base.types import OutputFormat, OutputFormatType, CLIOptions
from typing import Optional
from importlib.metadata import version, PackageNotFoundError
from d2x.env.gh import set_environment_variable, get_environment_variable, set_environment_secret, get_environment_secret
from d2x.auth.sf.auth_url import auth_url_main
from d2x.auth.sf.auth_url import login_url_main
from d2x.env.gh import (
set_environment_variable,
get_environment_variable,
set_environment_secret,
get_environment_secret,
)

# Disable rich_click's syntax highlighting
click.SHOW_ARGUMENTS = False
Expand Down Expand Up @@ -91,7 +96,13 @@ def env():
@click.argument("var_name")
@click.argument("var_value")
@common_options
def set_var(env_name: str, var_name: str, var_value: str, output_format: OutputFormatType, debug: bool):
def set_var(
env_name: str,
var_name: str,
var_value: str,
output_format: OutputFormatType,
debug: bool,
):
"""Set an environment variable"""
cli_options = CLIOptions(output_format=output_format, debug=debug)
try:
Expand Down Expand Up @@ -127,7 +138,13 @@ def get_var(env_name: str, var_name: str, output_format: OutputFormatType, debug
@click.argument("secret_name")
@click.argument("secret_value")
@common_options
def set_secret(env_name: str, secret_name: str, secret_value: str, output_format: OutputFormatType, debug: bool):
def set_secret(
env_name: str,
secret_name: str,
secret_value: str,
output_format: OutputFormatType,
debug: bool,
):
"""Set an environment secret"""
cli_options = CLIOptions(output_format=output_format, debug=debug)
try:
Expand All @@ -144,7 +161,9 @@ def set_secret(env_name: str, secret_name: str, secret_value: str, output_format
@click.argument("env_name")
@click.argument("secret_name")
@common_options
def get_secret(env_name: str, secret_name: str, output_format: OutputFormatType, debug: bool):
def get_secret(
env_name: str, secret_name: str, output_format: OutputFormatType, debug: bool
):
"""Get an environment secret"""
cli_options = CLIOptions(output_format=output_format, debug=debug)
try:
Expand Down
Loading

0 comments on commit a44852c

Please sign in to comment.