Skip to content

Commit 597071a

Browse files
Add setup files for the repo (#1)
* Add repo setup * Add code owners file * Update code owners * Update code config
1 parent 0c79a37 commit 597071a

File tree

11 files changed

+198
-18
lines changed

11 files changed

+198
-18
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Use the official Python image from Microsoft devcontainers
2+
FROM mcr.microsoft.com/devcontainers/python:3
3+
4+
# Install ODBC drivers and dependencies
5+
RUN apt-get update && \
6+
apt-get install -y apt-transport-https curl && \
7+
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
8+
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
9+
apt-get update && \
10+
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
11+
12+
# Set the working directory
13+
WORKDIR /app
14+
15+
# Copy the requirements file into the container
16+
COPY requirements.txt .
17+
18+
# Install Python dependencies
19+
RUN pip install -r requirements.txt

.devcontainer/devcontainer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"build": {
3+
"context": "..",
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"ms-python.python",
10+
"ms-python.vscode-pylance",
11+
"ms-toolsai.jupyter",
12+
"ms-azuretools.vscode-docker"
13+
],
14+
"settings": {
15+
"editor.formatOnSave": true
16+
}
17+
}
18+
},
19+
"features": {
20+
"ghcr.io/devcontainers-contrib/features/black:2": {}
21+
},
22+
"name": "Dev Container"
23+
}

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default owner for everything in the repo
2+
* @microsoft/dstoolkit-text2sql-and-imageprocessing-admins

.github/dependabot.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "deps"
9+
include: "scope"
10+
rebase-strategy: "auto"
11+
open-pull-requests-limit: 5
12+
labels:
13+
- "dependencies"
14+
- "automated-update"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [main]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [main]
20+
schedule:
21+
- cron: "38 19 * * 1"
22+
23+
permissions: read-all
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
runs-on: ubuntu-latest
29+
permissions:
30+
actions: read
31+
contents: read
32+
security-events: write
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
language: ["python"]
38+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
# queries: security-extended,security-and-quality
56+
57+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v2
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
64+
65+
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
67+
68+
# - run: |
69+
# echo "Run, Build Application using script"
70+
# ./location_of_script_within_repo/buildscript.sh
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2

.pre-commit-config.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
fail_fast: true
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.4.0
5+
hooks:
6+
# Invalid file checks
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-symlinks
10+
- id: check-toml
11+
12+
# File quality checks
13+
- id: end-of-file-fixer
14+
- id: trailing-whitespace
15+
16+
# Git checks
17+
- id: check-merge-conflict
18+
19+
# Python checks
20+
- id: name-tests-test
21+
22+
# JSON files
23+
- id: pretty-format-json
24+
args: [--autofix]
25+
26+
- id: check-json
27+
28+
- repo: https://github.com/codespell-project/codespell
29+
rev: v2.1.0
30+
hooks:
31+
- id: codespell
32+
33+
- repo: https://github.com/psf/black-pre-commit-mirror
34+
rev: 23.12.1
35+
hooks:
36+
- id: black
37+
38+
- repo: https://github.com/astral-sh/ruff-pre-commit
39+
# Ruff version.
40+
rev: v0.1.9
41+
hooks:
42+
# Run the linter.
43+
- id: ruff
44+
args: [--fix, --ignore, UP007]
45+
exclude: samples

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Contributing
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
4+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
6+
7+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
8+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
9+
provided by the bot. You will only need to do this once across all repos using our CLA.
10+
11+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

SUPPORT.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
# TODO: The maintainer of this repo has not yet edited this file
2-
3-
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
4-
5-
- **No CSS support:** Fill out this template with information about how to file issues and get help.
6-
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
7-
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
8-
9-
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
10-
111
# Support
122

13-
## How to file issues and get help
3+
## How to file issues and get help
144

15-
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16-
issues before filing new issues to avoid duplicates. For new issues, file your bug or
5+
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
6+
issues before filing new issues to avoid duplicates. For new issues, file your bug or
177
feature request as a new Issue.
188

19-
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20-
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21-
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
9+
For help and questions about using this project, please raise an issue or start a discussion.
2210

23-
## Microsoft Support Policy
11+
## Microsoft Support Policy
2412

25-
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
13+
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pre-commit
2+
ruff
3+
black

text2sql/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)