forked from drivendataorg/cookiecutter-data-science
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from GatlenCulp/vscode-customization
Added preconfigured .vscode workspace files, extension recommendations, debugger profiles, settings, and tasks in addition to a dynamic .cursorrules profile.
- Loading branch information
Showing
50 changed files
with
4,188 additions
and
866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "gotem", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.10-bullseye", | ||
"features": { | ||
"ghcr.io/dhoeric/features/act:1": {}, | ||
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {} | ||
}, | ||
"remoteEnv": { | ||
// "UV_FROZEN": "true", | ||
"UV_PYTHON_PREFERENCE": "only-managed", | ||
"UV_PROJECT_ENVIRONMENT": "${containerWorkspaceFolder}/.devcontainer/.venv", | ||
"VIRTUAL_ENV": "${containerWorkspaceFolder}/.devcontainer/.venv", | ||
"PATH": "${containerWorkspaceFolder}/.devcontainer/.venv/bin:${env:PATH}" | ||
}, | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh", | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-python.debugpy", | ||
"charliermarsh.ruff", | ||
"njpwerner.autodocstring", | ||
"rodolphebarbanneau.python-docstring-highlighter", | ||
"kevinrose.vsc-python-indent", | ||
"ms-toolsai.jupyter", | ||
"ms-toolsai.jupyter-renderers", | ||
"mechatroner.rainbow-csv", | ||
"sbsnippets.pytorch-snippets", | ||
"mads-hartmann.bash-ide-vscode", | ||
"timonwong.shellcheck", | ||
"foxundermoon.shell-format", | ||
"ms-vscode-remote.remote-containers", | ||
"ms-vscode-remote.remote-ssh", | ||
"ms-vscode-remote.remote-ssh-edit", | ||
"mathematic.vscode-pdf", | ||
"vitaliymaz.vscode-svg-previewer", | ||
"ctcuff.font-preview", | ||
"james-yu.latex-workshop", | ||
"shd101wyy.markdown-preview-enhanced", | ||
"esbenp.prettier-vscode", | ||
"mrmlnc.vscode-attrs-sorter", | ||
"richie5um2.vscode-sort-json", | ||
"2gua.rainbow-brackets", | ||
"aaron-bond.better-comments", | ||
"alefragnani.project-manager", | ||
"peterschmalfeldt.explorer-exclude", | ||
"christian-kohler.path-intellisense", | ||
"kisstkondoros.vscode-gutter-preview", | ||
"eamodio.gitlens", | ||
"humao.rest-client", | ||
"ms-vscode.makefile-tools", | ||
"task.vscode-task", | ||
"tamasfe.even-better-toml", | ||
"dotenv.dotenv-vscode", | ||
"redhat.vscode-yaml", | ||
"redhat.vscode-xml", | ||
"ibm.output-colorizer", | ||
"usernamehw.errorlens", | ||
"spmeesseman.vscode-taskexplorer", | ||
"exiasr.hadolint", | ||
"ms-azuretools.vscode-docker" | ||
], | ||
"settings": { | ||
// "dotfiles.repository": "https://github.com/GatlenCulp/dotfiles.git", | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/.devcontainer/.venv/bin/python", | ||
"python.testing.pytestPath": "${containerWorkspaceFolder}/.devcontainer/.venv/bin/pytest", | ||
"python.terminal.activateEnvironment": true | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Install Dependencies | ||
# uv sync --no-cache | ||
|
||
# Install pre-commit hooks | ||
# uv run pre-commit install --install-hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: test-specific | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
expression: | ||
description: 'Test expression to filter for' | ||
required: true | ||
type: choice | ||
options: | ||
- 'uv-none-mkdocs' | ||
- 'uv-none-none' | ||
- 'uv-requirements.txt-mkdocs' | ||
- 'uv-requirements.txt-none' | ||
- 'virtualenv-requirements.txt-mkdocs' | ||
- 'virtualenv-requirements.txt-none' | ||
- 'conda-requirements.txt-mkdocs' | ||
- 'conda-requirements.txt-none' | ||
- 'conda-environment.yml-mkdocs' | ||
- 'conda-environment.yml-none' | ||
- 'pipenv-Pipfile-mkdocs' | ||
- 'pipenv-Pipfile-none' | ||
- 'none-requirements.txt-mkdocs' | ||
- 'none-requirements.txt-none' | ||
os: | ||
description: 'Operating system to run on' | ||
required: true | ||
type: choice | ||
default: 'ubuntu-latest' | ||
options: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
|
||
jobs: | ||
tests-specific: | ||
name: Tests (${{ inputs.os }}) | ||
runs-on: ${{ inputs.os }} | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
allow-prereleases: true | ||
cache: "pip" | ||
cache-dependency-path: | | ||
pyproject.toml | ||
dev-requirements.txt | ||
- name: Set up Miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-activate-base: true | ||
activate-environment: "" | ||
|
||
- name: Cache conda packages | ||
uses: actions/cache@v4 | ||
env: | ||
# Increase this value to reset cache explicitly | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | ||
hashFiles('ccds/hook_utils/dependencies.py') }} | ||
|
||
- name: Setup for Windows | ||
if: ${{ inputs.os == 'windows-latest' }} | ||
run: | | ||
# Install GNU make | ||
choco install --verbose make | ||
# Add conda binaries directory to PATH so that conda is accessible | ||
echo "${CONDA}\Scripts" >> $GITHUB_PATH | ||
# Set bash executable explicitly since Make may pick wrong shell | ||
echo "BASH_EXECUTABLE=$(which bash)" >> "$GITHUB_ENV" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
make requirements | ||
- name: Check dependencies | ||
run: | | ||
if [[ -z "${BASH_EXECUTABLE}" ]]; then | ||
bash --version | ||
else | ||
echo $BASH_EXECUTABLE | ||
$BASH_EXECUTABLE --version | ||
fi | ||
which make | ||
make --version | ||
which conda | ||
conda --version | ||
which pipenv | ||
pipenv --version | ||
which virtualenv | ||
virtualenv --version | ||
- name: Run tests | ||
run: | | ||
make test ARGS="-k ${{ inputs.expression }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ docs/docs/_partials/*/*.html | |
|
||
# test cache | ||
manual_test/ | ||
.history | ||
|
||
# other local dev info | ||
# .vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: check-symlinks | ||
- id: check-yaml | ||
args: ["--allow-multiple-documents"] | ||
# - id: double-quote-string-fixer | ||
- id: forbid-new-submodules | ||
- repo: https://github.com/gitleaks/gitleaks | ||
rev: v8.22.0 | ||
hooks: | ||
- id: gitleaks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
"recommendations": [ | ||
// Python Development | ||
"ms-python.python", // Python Environments, Language, and More | ||
"ms-python.vscode-pylance", // Python Language Server w/ Typing | ||
"ms-python.debugpy", // VSCode Python Debugger | ||
"charliermarsh.ruff", // Fast Python Linter & Formatter | ||
"njpwerner.autodocstring", // Automatically generate Python docstrings | ||
"rodolphebarbanneau.python-docstring-highlighter", // Highlight Python docstring syntax | ||
"kevinrose.vsc-python-indent", // Correct indents for python | ||
|
||
// Data Science & Notebooks | ||
"ms-toolsai.jupyter", // Jupyter Notebooks in VSCode | ||
"ms-toolsai.jupyter-renderers", // Jupyter Cell Output Renderer | ||
"mechatroner.rainbow-csv", // Color-coded CSV Columns | ||
"sbsnippets.pytorch-snippets", // Snippits for PyTorch | ||
|
||
// Shell & Command Line | ||
"mads-hartmann.bash-ide-vscode", // .*sh script language support | ||
"timonwong.shellcheck", // .*sh script linting | ||
"foxundermoon.shell-format", // .*sh script formatting | ||
|
||
// Remote Development | ||
"ms-vscode-remote.remote-containers", // Remote Connect to Docker | ||
"ms-vscode-remote.remote-ssh", // Remote Connect via SSH | ||
"ms-vscode-remote.remote-ssh-edit", // SSH Config File Editing | ||
"exiasr.hadolint", // Dockerfile linter | ||
|
||
// Document Formats & Preview | ||
"mathematic.vscode-pdf", // PDF Preview | ||
"vitaliymaz.vscode-svg-previewer", // SVG Preview | ||
"ctcuff.font-preview", // Font PReview | ||
"james-yu.latex-workshop", // LaTeX File Renderer for Documents | ||
"shd101wyy.markdown-preview-enhanced", // Improved Markdown Preview | ||
|
||
// Code Formatting & Style | ||
"esbenp.prettier-vscode", // Prettier general formatting tool | ||
"mrmlnc.vscode-attrs-sorter", // HTML Attribute Sorter | ||
"richie5um2.vscode-sort-json", // JSON Sorter | ||
"2gua.rainbow-brackets", // Multi-colored brackets for readability | ||
"aaron-bond.better-comments", // Comments w/ Styling | ||
|
||
// Project Management & Navigation | ||
"alefragnani.project-manager", // Manage VSCode Workspaces | ||
/* Add the below to your projects.json file to add this project | ||
'~/Library/Application Support/Cursor/User/globalStorage/alefragnani.project-manager/projects.json' | ||
{ | ||
"name": "🍪 {{ cookiecutter.repo_name }}", | ||
"rootPath": "/Path/to/your/project/{{ cookiecutter.repo_name }}/.vscode/{{ cookiecutter.repo_name }}.code-workspace", | ||
"tags": [ | ||
"🪿 gotem" | ||
], | ||
"enabled": true | ||
}, | ||
*/ | ||
"peterschmalfeldt.explorer-exclude", // Keep Explorer Clean by Hiding Files | ||
"christian-kohler.path-intellisense", // Path Intellisense | ||
"kisstkondoros.vscode-gutter-preview", // Image Preview | ||
|
||
// Git & Version Control | ||
"eamodio.gitlens", // View git diffs, edits, branches and more | ||
|
||
// TODO: Add cookiecutter template types, include if web only | ||
// API Development | ||
"humao.rest-client", // Easily make HTTP queries for API testing | ||
|
||
// Build Tools | ||
"ms-vscode.makefile-tools", // Tools for Makefiles | ||
"task.vscode-task", // Tools for Taskfiles | ||
|
||
// Configuration Files | ||
"tamasfe.even-better-toml", // .toml language support | ||
"dotenv.dotenv-vscode", // .env language support | ||
"redhat.vscode-yaml", // .yaml language support | ||
"redhat.vscode-xml", // .xml language support | ||
|
||
// Output & Debugging | ||
"ibm.output-colorizer", // Automatically color-code VSCode Output logs | ||
"usernamehw.errorlens", | ||
"spmeesseman.vscode-taskexplorer", | ||
"ms-azuretools.vscode-docker" // Highlight errors in-line | ||
], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [ | ||
// Superceded by ruff | ||
"ms-python.black-formatter", | ||
"ms-python.isort", | ||
"ms-python.pylint", | ||
|
||
// Superceded by Pylance | ||
"ms-pyright.pyright" | ||
] | ||
} |
Oops, something went wrong.