Skip to content

Commit

Permalink
chore: init project
Browse files Browse the repository at this point in the history
  • Loading branch information
norskeld committed Feb 25, 2024
0 parents commit 326fdec
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
tab_width = 2
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
73 changes: 73 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: checks

# Note: All jobs (excepting `fmt`) by default use the same channel as defined in `rust-toolchain`.
# Note: All jobs run only a `ubuntu-latest`, no matrix whatsoever.

on:
push:
branches: [master]
paths-ignore: ["**.md"]
pull_request:
paths-ignore: ["**.md"]
workflow_dispatch:

jobs:
check:
name: cargo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check

clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test

fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Cargo, will have compiled files and executables.
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries.
Cargo.lock

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

# 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
.DS_Store
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.rulers": [100],
"editor.formatOnSave": true,
"editor.inlayHints.enabled": "offUnlessPressed",
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
"rust-analyzer.diagnostics.disabled": ["macro-error"],
"rust-analyzer.lens.enable": true,
"rust-analyzer.lens.implementations.enable": false
}
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "pingmole"
version = "0.1.0"
description = "Simple CLI that helps to filter and pick the closest Mullvad server."
authors = ["Vladislav Mamon <hello@vm.codes>"]
edition = "2021"

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

[profile.release]
lto = "thin"
panic = "abort"
debug = false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Mamon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# pingmole

[![Checks](https://img.shields.io/github/actions/workflow/status/norskeld/pingmole/checks.yml?style=flat-square&colorA=22272d&colorB=22272d&label=checks)](https://github.com/norskeld/pingmole/actions/workflows/checks.yml)

Simple CLI that helps to filter and pick the closest Mullvad server.

## License

[MIT](LICENSE).
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.74.0"
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable
35 changes: 35 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Enable unstable features, e.g. group_imports.
unstable_features = true
edition = "2021"

# Imports.
imports_indent = "Block"
imports_layout = "Mixed"
group_imports = "StdExternalCrate"
reorder_imports = true

# Enums, structs, etc.
reorder_impl_items = true
use_field_init_shorthand = true

# Tabs & spaces.
tab_spaces = 2
hard_tabs = false

# Commas.
trailing_comma = "Vertical"
match_block_trailing_comma = true

# General width constraints.
max_width = 100

# Match tweaks.
match_arm_leading_pipes = "Always" # Because I'm a weirdo.
force_multiline_blocks = true

# Comments.
wrap_comments = true
comment_width = 100

# Etc.
condense_wildcard_suffixes = true
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

0 comments on commit 326fdec

Please sign in to comment.