Skip to content

Commit

Permalink
Create clean version of repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ccunningham101 committed Nov 17, 2023
0 parents commit 7d4db71
Show file tree
Hide file tree
Showing 78 changed files with 11,734 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Retractobot CI"

on:
push:
branches:
- main
pull_request:

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: "opensafely-core/setup-action@v1"
with:
python-version: "3.10"
install-just: true
- name: Check formatting, linting and import sorting
run: just check

test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:14
env:
POSTGRES_USER: retractobot
POSTGRES_PASSWORD: xxx
POSTGRES_DB: retractobot
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: "opensafely-core/setup-action@v1"
with:
python-version: "3.10"
install-just: true

- name: Environment variables
run: cp environment-sample environment

- name: Install venv
run: just devenv

- name: Check migrations
run: |
just check-migrations
- name: Run tests
run: |
just test
109 changes: 109 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Created by https://www.toptal.com/developers/gitignore/api/osx,macos,linux,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=osx,macos,linux,windows

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### OSX ###
# General

# Icon must end with two \r

# Thumbnails

# Files that might appear in the root of a volume

# Directories potentially created on remote AFP share

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/osx,macos,linux,windows

# Python
__pycache__
*.pyc

# Coverage
.coverage
htmlcov

# IDEs
.idea/


# Virtual environments
.venv/
venv/

.pytest-cache/


# Application
debug-last-sent-mails.mbox
live-all-sent-mails.mbox
environment
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
default_language_version:
python: python3.10

repos:
- repo: local
hooks:
- id: black
name: black
entry: just black
language: system
types: [python]
require_serial: true
- id: ruff
name: ruff
entry: just ruff
language: system
types: [python]
require_serial: true

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- id: detect-private-key

- repo: https://github.com/stratasan/hadolint-pre-commit
rev: cdefcb0
hooks:
- id: hadolint
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
Loading

0 comments on commit 7d4db71

Please sign in to comment.