Skip to content

Commit

Permalink
feat: improve cargo manifest, add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Jul 19, 2024
1 parent be343e1 commit b3825e7
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: xhyrom
1 change: 1 addition & 0 deletions .github/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
only for github mirror
28 changes: 28 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check
on:
push:
pull_request:

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: install rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: cache dependencies
uses: Swatinem/rust-cache@v2

- name: check
run: cargo check --all

- name: fmt
run: cargo fmt --all -- --check

- name: clippy
run: cargo clippy --all -- -D warnings
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name = "zed-discord-presence"
version = "0.1.0"
edition = "2021"
license = "GNU General Public License v3.0"
license-file = "LICENSE"
repository = "https://git.sr.ht/~hyro/zed-discord-presence"

[lib]
path = "src/discord_presence.rs"
Expand All @@ -12,3 +15,12 @@ zed_extension_api = "0.0.6"

[workspace]
members = ["lsp"]

[lints]
[lints.clippy]
correctness = "deny"
suspicious = "warn"
complexity = "warn"
perf = "warn"
style = "deny"
pedantic = "warn"
5 changes: 3 additions & 2 deletions src/discord_presence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct DiscordPresenceExtension {
cached_binary_path: Option<String>,
}

#[allow(clippy::match_wildcard_for_single_variants)]
impl DiscordPresenceExtension {
fn language_server_binary_path(
&mut self,
Expand Down Expand Up @@ -40,7 +41,7 @@ impl DiscordPresenceExtension {
arch = match arch {
zed::Architecture::Aarch64 => "aarch64",
zed::Architecture::X8664 => "x86_64",
_ => return Err(format!("unsupported architecture: {:?}", arch)),
_ => return Err(format!("unsupported architecture: {arch:?}")),
},
os = match platform {
zed::Os::Mac => "apple-darwin",
Expand All @@ -57,7 +58,7 @@ impl DiscordPresenceExtension {
.assets
.iter()
.find(|asset| asset.name == asset_name)
.ok_or_else(|| format!("no asset found matching {:?}", asset_name))?;
.ok_or_else(|| format!("no asset found matching {asset_name:?}"))?;

let version_dir = format!("discord-presence-lsp-{}", release.version);
let asset_name = asset_name
Expand Down

0 comments on commit b3825e7

Please sign in to comment.