Skip to content

Commit

Permalink
Merge pull request #3 from thedropbears/fix_repository
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienMorey authored Oct 22, 2024
2 parents 9c65a4c + df614d3 commit 563fbbd
Show file tree
Hide file tree
Showing 60 changed files with 2,060 additions and 801 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches:
- main
pull_request:
merge_group:

jobs:
test:
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
cache: true
- name: Install dependencies
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m pip install coverage pytest-github-actions-annotate-failures
- run: pdm run robotpy coverage test
- run: pdm run coverage xml
- uses: codecov/codecov-action@v4
with:
use_oidc: true

mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
cache: true
- name: Install dependencies
run: |
pdm install
- name: mypy
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: mypy
run: pdm run mypy --show-column-numbers .
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
### Python ###
__pycache__/

# Unit test / coverage reports
htmlcov/
.coverage
.coverage.*
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# pyenv
.python-version

# pdm
.pdm-python
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Rope project settings
.ropeproject

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre
.pyre/

# pytype static type analyzer
.pytype/

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

### VS Code ###
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### WPILib ###
networktables.json
simgui*.json
logs/
ctre_sim/
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_prs: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Side effects
- id: fix-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
# Non-modifying checks
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args:
- "--fix"

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"charliermarsh.ruff"
]
}
39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "RobotPy: Simulate",
"type": "python",
"request": "launch",
"module": "robotpy",
"args": [
"sim"
]
},
{
"name": "RobotPy: Test",
"type": "python",
"request": "launch",
"module": "robotpy",
"args": [
"test"
]
},
{
"name": "Python: Attach to roboRIO",
"type": "python",
"request": "attach",
"port": 5678,
"host": "10.47.74.2",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
}
]
}
47 changes: 47 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "deploy with netconsole",
"type": "process",
"group": "build",
"command": "${command:python.interpreterPath}",
"args": [
"-m",
"robotpy",
"deploy",
"--nc"
]
},
{
"label": "deploy",
"type": "process",
"group":{
"kind": "build",
"isDefault": true
},
"command": "${command:python.interpreterPath}",
"args": [
"-m",
"robotpy",
"deploy"
]
},
{
"label": "test",
"type": "process",
"group": {
"kind": "test",
"isDefault": true
},
"command": "${command:python.interpreterPath}",
"args": [
"-m",
"robotpy",
"test"
]
}
]
}
3 changes: 3 additions & 0 deletions .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"teamNumber": 4774
}
Empty file added components/__init__.py
Empty file.
Loading

0 comments on commit 563fbbd

Please sign in to comment.