Skip to content

Commit f24e11e

Browse files
authored
Merge pull request #146 from daboross/daboross/cleanup
Misc. repository cleanup
2 parents 09d86b6 + fdba420 commit f24e11e

File tree

9 files changed

+95
-215
lines changed

9 files changed

+95
-215
lines changed

.github/workflows/rust.yml

Lines changed: 32 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ name: tests
22

33
on:
44
push:
5-
branches: main
65
pull_request:
7-
branches: main
86

97
env:
108
CARGO_TERM_COLOR: always
119

1210
jobs:
1311
test:
14-
name: Test Suite
12+
name: Run Tests
1513
runs-on: ${{ matrix.os }}
1614
strategy:
1715
matrix:
@@ -21,64 +19,26 @@ jobs:
2119
os:
2220
- ubuntu-latest
2321
- windows-latest
22+
toolchain:
23+
- stable
24+
- 1.70.0
2425
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions-rs/toolchain@v1
27-
with:
28-
profile: minimal
29-
toolchain: ${{ matrix.rust }}
30-
override: true
31-
- uses: actions-rs/cargo@v1
32-
with:
33-
command: build
34-
args: --lib --bins --examples --tests --benches
35-
- uses: actions-rs/cargo@v1
36-
with:
37-
command: build
38-
args: --lib --bins --examples --tests --benches --all-features
39-
- uses: actions-rs/cargo@v1
40-
with:
41-
command: test
42-
- uses: actions-rs/cargo@v1
43-
with:
44-
command: test
45-
args: --no-default-features
46-
- uses: actions-rs/cargo@v1
47-
with:
48-
command: test
49-
args: --features=colored
50-
- uses: actions-rs/cargo@v1
51-
with:
52-
command: test
53-
args: --features=syslog-3
54-
- uses: actions-rs/cargo@v1
55-
with:
56-
command: test
57-
args: --features=syslog-4
58-
- uses: actions-rs/cargo@v1
59-
with:
60-
command: test
61-
args: --features=syslog-6
62-
- uses: actions-rs/cargo@v1
63-
with:
64-
command: test
65-
args: --features=syslog-7
66-
- uses: actions-rs/cargo@v1
67-
with:
68-
command: test
69-
args: --features=reopen-03
70-
- uses: actions-rs/cargo@v1
71-
with:
72-
command: test
73-
args: --features=reopen-1
74-
- uses: actions-rs/cargo@v1
75-
with:
76-
command: test
77-
args: --features=meta-logging-in-format
78-
- uses: actions-rs/cargo@v1
79-
with:
80-
command: test
81-
args: --all-features
26+
- uses: actions/checkout@v4
27+
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
28+
- run: cargo build --all-targets
29+
- run: cargo build --all-targets --no-default-features
30+
- run: cargo build --all-targets --all-features
31+
- run: cargo test
32+
- run: cargo test --no-default-features
33+
- run: cargo test --features=colored
34+
- run: cargo test --features=syslog-3
35+
- run: cargo test --features=syslog-4
36+
- run: cargo test --features=syslog-6
37+
- run: cargo test --features=syslog-7
38+
- run: cargo test --features=reopen-03
39+
- run: cargo test --features=reopen-1
40+
- run: cargo test --features=meta-logging-in-format
41+
- run: cargo test --all-features
8242
- run: cargo run --example cmd-program
8343
- run: cargo run --example cmd-program -- --verbose
8444
- run: cargo run --example colored --features colored
@@ -90,115 +50,40 @@ jobs:
9050
env:
9151
RUSTDOCFLAGS: -D warnings
9252
linux:
93-
name: Linux-only Examples
53+
name: Linux Examples
9454
runs-on: ubuntu-latest
9555
strategy:
9656
matrix:
9757
rust:
9858
- stable
9959
- beta
60+
toolchain:
61+
- stable
62+
- 1.70.0
10063
steps:
101-
- uses: actions/checkout@v2
102-
- uses: actions-rs/toolchain@v1
103-
with:
104-
profile: minimal
105-
toolchain: ${{ matrix.rust }}
106-
override: true
64+
- uses: actions/checkout@v4
65+
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
10766
- run: cargo run --example syslog3 --features syslog-3
10867
- run: cargo run --example syslog4 --features syslog-4
10968
- run: cargo run --example syslog --features syslog-6
11069
- run: cargo run --example syslog7 --features syslog-7
11170
msrv:
112-
name: MSRV Compatability - fern
71+
name: MSRV Compat
11372
runs-on: ${{ matrix.os }}
11473
strategy:
11574
matrix:
11675
os:
11776
- ubuntu-latest
11877
- windows-latest
11978
steps:
120-
- uses: actions/checkout@v2
121-
- uses: actions-rs/toolchain@v1
122-
with:
123-
profile: minimal
124-
# when updating this, also update rust-version in Cargo.toml
125-
toolchain: 1.60.0
126-
override: true
79+
- uses: actions/checkout@v4
80+
- run: rustup update 1.60.0 && rustup default 1.60.0
12781
- run: cargo build
128-
msrv2:
129-
name: MSRV Compatability - fern/date-based
130-
runs-on: ${{ matrix.os }}
131-
strategy:
132-
matrix:
133-
os:
134-
- ubuntu-latest
135-
- windows-latest
136-
steps:
137-
- uses: actions/checkout@v2
138-
- uses: actions-rs/toolchain@v1
139-
with:
140-
profile: minimal
141-
toolchain: 1.63.0
142-
override: true
143-
- run: cargo build --features date-based
144-
- run: cargo build --features reopen-1,reopen-03,meta-logging-in-format,syslog-3
145-
msrv_syslog_4:
146-
name: MSRV Compatability - fern/syslog-4
147-
runs-on: ${{ matrix.os }}
148-
strategy:
149-
matrix:
150-
os:
151-
- ubuntu-latest
152-
- windows-latest
153-
steps:
154-
- uses: actions/checkout@v2
155-
- uses: actions-rs/toolchain@v1
156-
with:
157-
profile: minimal
158-
toolchain: 1.65.0
159-
override: true
160-
- run: cargo build --features syslog-4
161-
msrv_syslog_6:
162-
name: MSRV Compatability - fern/syslog-6
163-
runs-on: ${{ matrix.os }}
164-
strategy:
165-
matrix:
166-
os:
167-
- ubuntu-latest
168-
- windows-latest
169-
steps:
170-
- uses: actions/checkout@v2
171-
- uses: actions-rs/toolchain@v1
172-
with:
173-
profile: minimal
174-
toolchain: 1.67.1
175-
override: true
176-
- run: cargo build --features syslog-6
177-
msrv_syslog_7:
178-
name: MSRV Compatability - fern/syslog-7
179-
runs-on: ${{ matrix.os }}
180-
strategy:
181-
matrix:
182-
os:
183-
- ubuntu-latest
184-
- windows-latest
185-
steps:
186-
- uses: actions/checkout@v2
187-
- uses: actions-rs/toolchain@v1
188-
with:
189-
profile: minimal
190-
toolchain: 1.67.1
191-
override: true
192-
- run: cargo build --features syslog-7
193-
fmt_and_clippy:
82+
optional_lints:
19483
name: Optional Lints
19584
runs-on: ubuntu-latest
19685
steps:
197-
- uses: actions/checkout@v2
198-
- uses: actions-rs/toolchain@v1
199-
with:
200-
profile: minimal
201-
toolchain: stable
202-
override: true
86+
- uses: actions/checkout@v4
87+
- run: rustup update stable && rustup default stable
20388
- run: cargo fmt --check
20489
- run: cargo clippy --all-features --all-targets -- -D warnings

CONTRIBUTING.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
### Contributing
1+
# Contributing
22

3-
#### Getting started (section in README)
43

5-
Contributions are welcome!
4+
## Overview (mirrored in README)
65

7-
The easiest way for you to contribute right now is to use `fern` in your application, and see where it's lacking. The current library should have a solid base, but not many log adapters or niche features.
6+
There's one thing I need right now, more than anything else: input on what fern does well, and what it should keep
7+
doing well. See [Project Direction](#project-direction).
88

9-
If you have a use case `fern` does not cover, filing an issue will be immensely useful to me, to anyone wanting to contribute to the project, and (hopefully) to you once the feature is implemented!
9+
Besides that, I'm open to PRs! I'll probably review promptly, and I'm always open to being nudged if I don't.
1010

11-
If you've just filed an issue, or you want to approach one of our [existing ones](https://github.com/daboross/fern/issues), mentoring is available! Tag me with @daboross on an issue, or send me an email at daboross @ daboross.net, and I'll be available to help.
11+
For small PRs, I'll mark anything I need changed in a review, and work with you on that.
1212

13-
As a note, all contributions are expected to follow [the Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
13+
For larger PRs, I reserve the right to pull in your commits as they are, then fix things I want to be different myself.
14+
In a workplace, I'd try to never do this - but this is a hobby project for me, and I'd rather be overly particular about
15+
fern's implementation than be reasonable.
1416

15-
#### `fern` project structure
17+
This is a change from my previous policy.
18+
19+
## Code of Conduct.
20+
21+
All interactions are expected to follow [the Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
22+
23+
## `fern` project structure
1624

1725
Fern attempts to be an idiomatic rust library and to maintain a sane structure. All source code is located in `src/`, and tests are in `tests/`.
1826

@@ -24,40 +32,29 @@ The source is split into four modules:
2432

2533
Hopefully these modules are fairly separated, and it's clear when you'll need to work on multiple sections. Adding a new log implementation, for instance, will need to touch `builders.rs` for configuration, and `log_impl.rs` for the implementation - both pieces of code will connect via `builders::Dispatch::into_dispatch`, but besides that, things should be fairly separate.
2634

27-
#### Pull requests
35+
## Pull requests
2836

2937
Pull requests are _the_ way to change code using git. If you aren't familiar with them in general, GitHub has some [excellent documentation](https://help.github.com/articles/about-pull-requests/).
3038

3139
There aren't many hard guidelines in this repository on how specifically to format your request. Main points:
3240

3341
- Please include a descriptive title for your pull request, and elaborate on what's changed in the description.
3442
- Feel free to open a PR before the feature is completely ready, and commit directly to the PR branch.
35-
- This is also great for review of PRs before merging
36-
- All commits will be squashed together on merge, so don't worry about force pushing yourself.
3743
- Please include at least a short description in each commit, and more of one in the "main" feature commit. Doesn't
3844
have to be much, but someone reading the history should easily tell what's different now from before.
39-
- If you have `rustfmt-nightly` installed, using it is recommended. I can also format the code after merging the code,
40-
but formatting it consistently will make reviewing nicer.
41-
42-
### Testing
45+
- Use `cargo fmt` to format your code.
4346

47+
## Testing
4448

45-
Building fern is as easy as is expected, `cargo build`.
46-
47-
As of fern 0.5, testing can also easily be done with `cargo test`.
48-
49-
To run and test the example programs, use:
49+
To run build everything and run all tests, use:
5050

5151
```sh
52-
cargo run --example cmd-program # test less logging
53-
cargo run --example cmd-program -- --verbose # test more logging
54-
cargo run --example colored --features=colored # test colored log levels
52+
cargo build --all-features --all-targets
53+
cargo test --all-features
5554
```
5655

57-
Feel free to add tests and examples demonstrating new features as you see fit. Pull requests which solely add new/interesting example programs are also welcome.
58-
59-
### Mentoring
56+
## Mentoring
6057

61-
With all that said, contributing to a library, especially if new to rust, can be daunting.
58+
Contributing to a project can be daunting.
6259

63-
Feel free to email me at daboross @ daboross.net with any questions!
60+
Email me at daboross @ daboross.net with any questions!

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "fern"
44
version = "0.7.1"
55
authors = ["David Ross <[email protected]>"]
66
description = "Simple, efficient logging"
7-
edition = "2018"
7+
edition = "2021"
88
# when updating this, also update toolchain in .github/workflows/rust.yml
99
rust-version = "1.60"
1010

0 commit comments

Comments
 (0)