Skip to content

Commit 98dbd74

Browse files
committed
chore: add skeleton for simple-redis
0 parents  commit 98dbd74

File tree

14 files changed

+668
-0
lines changed

14 files changed

+668
-0
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v*
9+
pull_request:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build-rust:
18+
strategy:
19+
matrix:
20+
platform: [ubuntu-latest]
21+
runs-on: ${{ matrix.platform }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
submodules: recursive
27+
- name: Install Rust
28+
run: rustup toolchain install stable --component llvm-tools-preview
29+
- name: Install cargo-llvm-cov
30+
uses: taiki-e/install-action@cargo-llvm-cov
31+
- name: install nextest
32+
uses: taiki-e/install-action@nextest
33+
- uses: Swatinem/rust-cache@v2
34+
- name: Check code format
35+
run: cargo fmt -- --check
36+
- name: Check the package for errors
37+
run: cargo check --all
38+
- name: Lint rust sources
39+
run: cargo clippy --all-targets --all-features --tests --benches -- -D warnings
40+
- name: Execute rust tests
41+
run: cargo nextest run --all-features
42+
- name: Generate a changelog
43+
uses: orhun/git-cliff-action@v2
44+
id: git-cliff
45+
if: startsWith(github.ref, 'refs/tags/')
46+
with:
47+
config: cliff.toml
48+
args: -vv --latest --strip header
49+
env:
50+
OUTPUT: CHANGES.md
51+
- name: Release
52+
uses: softprops/action-gh-release@v1
53+
if: startsWith(github.ref, 'refs/tags/')
54+
with:
55+
body: ${{ steps.git-cliff.outputs.content }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target
2+
.DS_Store
3+
/.vscode

.pre-commit-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
fail_fast: false
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.3.0
5+
hooks:
6+
- id: check-byte-order-marker
7+
- id: check-case-conflict
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-yaml
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: trailing-whitespace
14+
- repo: https://github.com/psf/black
15+
rev: 22.10.0
16+
hooks:
17+
- id: black
18+
- repo: local
19+
hooks:
20+
- id: cargo-fmt
21+
name: cargo fmt
22+
description: Format files with rustfmt.
23+
entry: bash -c 'cargo fmt -- --check'
24+
language: rust
25+
files: \.rs$
26+
args: []
27+
- id: cargo-deny
28+
name: cargo deny check
29+
description: Check cargo dependencies
30+
entry: bash -c 'cargo deny check -d'
31+
language: rust
32+
files: \.rs$
33+
args: []
34+
- id: typos
35+
name: typos
36+
description: check typo
37+
entry: bash -c 'typos'
38+
language: rust
39+
files: \.*$
40+
pass_filenames: false
41+
- id: cargo-check
42+
name: cargo check
43+
description: Check the package for errors.
44+
entry: bash -c 'cargo check --all'
45+
language: rust
46+
files: \.rs$
47+
pass_filenames: false
48+
- id: cargo-clippy
49+
name: cargo clippy
50+
description: Lint rust sources
51+
entry: bash -c 'cargo clippy --all-targets --all-features --tests --benches -- -D warnings'
52+
language: rust
53+
files: \.rs$
54+
pass_filenames: false
55+
- id: cargo-test
56+
name: cargo test
57+
description: unit test for the project
58+
entry: bash -c 'cargo nextest run --all-features'
59+
language: rust
60+
files: \.rs$
61+
pass_filenames: false

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
4+
5+
---
6+
## [unreleased]
7+
8+
### Miscellaneous Chores
9+
10+
- initialize basic structure for the repo - ([2436bec](https://github.com/tyrchen/qdrant-lib/commit/2436bec4a02caac64f6c1f97ca79b6ce745b4f53)) - Tyr Chen
11+
12+
### Other
13+
14+
- init the project and add the assets - ([6a3ca0a](https://github.com/tyrchen/qdrant-lib/commit/6a3ca0a900451c55969cc8dec20afb5351d86599)) - Tyr Chen
15+
16+
<!-- generated by git-cliff -->

Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "template" # enter your project name
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["Noah <[email protected]>"]
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
anyhow = "^1.0"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Noah
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Rust Template
2+
3+
## Environment settings
4+
5+
### Install Rust
6+
7+
```bash
8+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
9+
```
10+
11+
### Install VSCode Extensions
12+
13+
- crates: Rust package management
14+
- Even Better TOML: TOML file support
15+
- Better Comments: Optimized comment display
16+
- Error Lens: Improved error prompts
17+
- GitLens: Enhanced Git features
18+
- Github Copilot: Code suggestions
19+
- indent-rainbow: Indentation display optimization
20+
- Prettier - Code formatter: Code formatting tool
21+
- REST client: REST API debugging tool
22+
- rust-analyzer:Rust language support
23+
- Rust Test lens:Rust test support
24+
- Rust Test Explorer:Rust test overview
25+
- TODO Highlight:TODO highlighting
26+
- vscode-icons:Icon optimization
27+
- YAML:YAML file support
28+
29+
### Install cargo generate
30+
31+
cargo generate is a tool for generating project templates. It can use an existing GitHub repo as a template to generate a new project.
32+
33+
```bash
34+
cargo install cargo-generate
35+
```
36+
The new project will use the `upupnoah/rust-template` template to generate basic code::
37+
38+
```bash
39+
cargo generate upupnoah/rust-template
40+
```
41+
42+
### Install pre-commit
43+
44+
pre-commit is a code checking tool that can perform code checks before committing code.
45+
46+
```bash
47+
pipx install pre-commit
48+
```
49+
50+
After successful installation, run `pre-commit install`.
51+
52+
### Install cargo-deny
53+
54+
Cargo deny is a Cargo plugin that can be used to check the security of dependencies.
55+
56+
```bash
57+
cargo install --locked cargo-deny
58+
```
59+
60+
### Install typos
61+
62+
Typos is a spell checking tool.
63+
64+
```bash
65+
cargo install typos-cli
66+
```
67+
68+
### Install git-cliff
69+
70+
git cliff is a tool for generating changelogs.
71+
72+
```bash
73+
cargo install git-cliff
74+
```
75+
76+
### Install cargo nextest
77+
78+
cargo nextest is an enhanced testing tool for Rust.
79+
80+
```bash
81+
cargo install cargo-nextest --locked
82+
```
83+
84+
## Template Usage
85+
86+
1. cargo generate rust-noah/rust-template
87+
88+
2. Enter the directory, modify the cliff.toml file, change the URL after replace= to your own repository address (you need to create a repository first)
89+
1. Create an empty repository on GitHub (excluding README, .gitignore, and LICENSE).
90+
2. cd new-project-dir (Name of the new project)
91+
3. Execute the command in the empty project created in step 1 (git remote add ...)
92+
93+
3. pre-commit install
94+
95+
4. Change the package.name in the Cargo.toml file to the name of the new project.
96+
97+
Note:
98+
- If git commit encounters problems, please delete `deny.toml` and then execute `cargo deny init`
99+
- Add the code below to licenses.
100+
```toml
101+
unlicensed = "allow"
102+
allow = [
103+
"MIT",
104+
"Apache-2.0",
105+
"Unicode-DFS-2016",
106+
"MPL-2.0",
107+
"BSD-2-Clause",
108+
"BSD-3-Clause",
109+
"ISC",
110+
"CC0-1.0",
111+
]
112+
```

_typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[default.extend-words]
2+
3+
[files]
4+
extend-exclude = ["CHANGELOG.md", "notebooks/*"]

assets/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Assets
2+
3+
- [juventus.csv](./juventus.csv): dataset from [The-Football-Data](https://github.com/buckthorndev/The-Football-Data).

0 commit comments

Comments
 (0)