Skip to content

Commit f6c0ff9

Browse files
authored
Fmt, Clippy, CI to match other georust proj (#9)
Please rename the primary branch to `main` for consistency. Similar to other georust projects, make CI: * go through additional fmt and clippy validation * run on pull requests, but ignore non-standard branches (it is usually easier to submit PRs from personal forks, but some maintainers may do it from the primary repo) * run fmt and clippy * add `TileJSONBuilder::default()` * ignore intellij files Minor cleanup: * use `.to_string()` everywhere for consistency * use Self when possible * remove `serde_json` dependency * use 2021 edition Also, get rid of the custom `cargo-all-features` as it is not really needed, so using the KISS principle :)
1 parent 46b1232 commit f6c0ff9

File tree

5 files changed

+342
-297
lines changed

5 files changed

+342
-297
lines changed

.github/workflows/rust.yml

+41-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
1-
on: push
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- staging
6+
- trying
7+
- release/**
8+
pull_request:
9+
schedule: [cron: "45 6 * * *"]
10+
11+
env:
12+
RUST_TOOLCHAIN: stable
13+
TOOLCHAIN_PROFILE: default
14+
215
name: Run tests
316
jobs:
4-
build_and_test:
17+
lints:
18+
name: Run cargo fmt and cargo clippy
519
runs-on: ubuntu-latest
620
steps:
7-
- uses: actions/checkout@v2
8-
- run: cargo install cargo-all-features
9-
- run: cargo build-all-features --verbose
10-
- run: cargo test-all-features --verbose
21+
- name: Checkout sources
22+
uses: actions/checkout@v2
23+
- name: Install toolchain
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
profile: ${{ env.TOOLCHAIN_PROFILE }}
27+
toolchain: ${{ env.RUST_TOOLCHAIN }}
28+
override: true
29+
components: rustfmt, clippy
30+
- name: Cache
31+
uses: Swatinem/rust-cache@v1
32+
- name: Run cargo fmt
33+
uses: actions-rs/cargo@v1
34+
with:
35+
command: fmt
36+
args: --all -- --check
37+
- name: Run cargo clippy
38+
uses: actions-rs/cargo@v1
39+
with:
40+
command: clippy
41+
args: -- -D warnings
42+
- name: Run cargo test
43+
uses: actions-rs/cargo@v1
44+
with:
45+
command: test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target/
22
**/*.rs.bk
33
Cargo.lock
4+
.idea

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### Unreleased
2+
3+
* for consistency, add `TileJSONBuilder::default()` - same as `::new()`
4+
* Migrate to Rust 2021 edition
5+
* Remove `serde_json` dependency
6+
17
<a name="v0.2.4"></a>
28
### v0.2.4 (2021-10-11)
39

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "tilejson"
33
version = "0.2.5-alpha.0"
44
description = "Library for serializing the TileJSON file format"
55
authors = ["Stepan Kuzmin <to.stepan.kuzmin@gmail.com>"]
6-
edition = "2018"
6+
edition = "2021"
77
license = "MIT OR Apache-2.0"
88
documentation = "https://docs.rs/tilejson"
99
homepage = "https://github.com/georust/tilejson"
@@ -13,4 +13,6 @@ keywords = ["mapbox", "tilejson", "serde"]
1313

1414
[dependencies]
1515
serde = { version = "1.0", features = ["derive"] }
16+
17+
[dev-dependencies]
1618
serde_json = "1.0"

0 commit comments

Comments
 (0)