Skip to content

Commit

Permalink
Merge pull request #22 from SINTEF/v2
Browse files Browse the repository at this point in the history
SensApp Version 2 rewrite in Rust with different databases
  • Loading branch information
fungiboletus authored Jan 11, 2024
2 parents e0af4dc + cb8d608 commit 5a5cdba
Show file tree
Hide file tree
Showing 1,463 changed files with 776 additions and 420,776 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Top-most EditorConfig file
root = true

# All files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Rust files
[*.rs]
indent_style = space
indent_size = 4
max_line_length = 100

# TOML files (like Cargo.toml)
[*.toml]
indent_style = space
indent_size = 2
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cargo Build & Test

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
#- nightly
steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose
13 changes: 13 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pre-commit

on:
push:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
34 changes: 16 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
.metadata/
*.cache
sandbox.services/
# Apple's crap
.DS_Store
*~
sandbox.*
*.iml
*.ipr
*.iws
keystore
/.idea/
.settings
.directory
target
*/.svn/*
**/.svn/*
**/bin/*
/.svn/
net.modelbased.sensapp.backyard.weather/src/main/resources/

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
5 changes: 5 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[general]
# Ignore rules, reference them by id or name (comma-separated)
ignore=body-is-missing,CC1

contrib=contrib-title-conventional-commits
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-json
- id: check-yaml
- id: check-xml
- id: check-ast
- id: end-of-file-fixer
- id: check-merge-conflict
- id: no-commit-to-branch # no commits to main
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.1
hooks:
- id: gitleaks
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"matklad.rust-analyzer",
"serayuzgur.crates",
"EditorConfig.EditorConfig",
"bungcip.better-toml",
"vadimcn.vscode-lldb",
"usernamehw.errorlens"
],
"unwantedRecommendations": [
"rust-lang.rust-vscode"
]
}
42 changes: 42 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'sensapp'",
"cargo": {
"args": [
"build",
"--bin=sensapp",
"--package=sensapp"
],
"filter": {
"name": "sensapp",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'sensapp'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=sensapp",
"--package=sensapp"
],
"filter": {
"name": "sensapp",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
74 changes: 74 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributing

Thank you for your contributions in making SensApp better!

## Discuss Changes

For significant changes, please open an issue first to discuss what you would like to change. This helps us align your contributions with our project goals.

## Pre-commits hooks

Please use pre-commits hooks to check your changes locally. Your change will also be checked by the continuous integration (CI) pipeline, but it is faster to catch errors locally before pushing your changes.

```
pip install pre-commit
pre-commit install
pre-commit install --hook-type commit-msg
```

## Language

We use Rust.

## Code Style

We follow the [Rust Style Guide](https://github.com/rust-lang/rust/tree/HEAD/src/doc/style-guide/src).

## Tests

Update tests as appropriate. New features should come with additional tests.

## Documentation

**Documentation**: Update the `README.md` or other documentation with details of changes to the interface or additional features.

## Issues

Make sure you use the latest version of SensApp and please include enough information about the issue. The more information you provide, the easier it is to reproduce the issue and to fix it.

## ~~Pull~~ Merge Requests

You are not allowed to push to the `main` branch. Please create a merge request instead.

Please do NOT `squash` your merge requests. You are welcome to organise and clean your commits first, but we want to keep the commit history.

Avoid merging your own pull requests without a review. Do not merge a pull request with failing tests.

## Commit Messages

We use [Conventional Commits](https://www.conventionalcommits.org/).

```
<type>[(optional scope)]: <description>
[optional body]
[optional footer(s)]
```

Examples:

```
fix: prevent infinite loop when it rains
docs(architecture): correct spelling of banana
```

Valid types are: fix, feat, chore, docs, style, refactor, perf, test, revert, ci, and build.

To please the [gitmoji](https://gitmoji.dev) enthousiasts, unicode emojis are allowed but not enforced. Commit messages with emojis still must respect the conventional commit format.

Examples:
```
fix: 🐛 prevent infinite loop when it rains
docs(architecture): 📝 correct spelling of banana
```
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "sensapp"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
20 changes: 0 additions & 20 deletions LICENCE_HEADER.txt

This file was deleted.

Loading

0 comments on commit 5a5cdba

Please sign in to comment.