Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt -- --check

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --verbose
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contributing

Thank you for your interest in contributing to Chai (:

This document provides guidelines for contributing to the project.

## Code Formatting

This project uses **default rustfmt settings**. To ensure consistent code style across all contributions:

1. **Check formatting locally** before pushing:

```sh
cargo fmt -- --check
```

2. **Fix formatting** if the check fails:

```sh
cargo fmt
```

3. **CI will block PRs** with incorrect formatting. Fix any issues before merging.

**Important**: Do not create a `rustfmt.toml` file or override rustfmt settings. Chai uses the default configuration to ensure consistency.

## Development Workflow

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Run `cargo fmt -- --check` to verify formatting
5. Run `cargo build` and `cargo test` to verify everything works
6. Submit a pull request and link it to the relevant issue

## Questions?

Feel free to open an issue if you have questions about contributing!
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ For examples, see [here](https://github.com/kllarena07/chai/tree/main/examples).

---

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, including code formatting requirements.

## Contributors

<a href="https://github.com/kllarena07/chai-framework/graphs/contributors">
Expand Down
3 changes: 2 additions & 1 deletion examples/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async fn main() {
..Default::default()
};

let mut server = ChaiServer::<MyApp>::new(2222).with_tick_rate(std::time::Duration::from_millis(250));
let mut server =
ChaiServer::<MyApp>::new(2222).with_tick_rate(std::time::Duration::from_millis(250));
server.run(config).await.expect("Failed running server");
}
1 change: 0 additions & 1 deletion src/chai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ pub trait ChaiApp {

/// called just before a client disconnects.
fn on_disconnect(&mut self, _username: &str) {}

}
1 change: 0 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,3 @@ pub fn load_host_keys(path: &str) -> Result<russh::keys::PrivateKey, anyhow::Err

Ok(key)
}

Loading