Skip to content

Commit

Permalink
Readme + clippy + Linear refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Aug 18, 2024
1 parent dd659ca commit e60e049
Show file tree
Hide file tree
Showing 12 changed files with 686 additions and 87 deletions.
65 changes: 65 additions & 0 deletions .rustme/config.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Configuration(
files: {
"../README.md": (
for_docs: false,
sections: [
"header.md",
"docs.md",
"https://github.com/khonsulabs/.github/raw/main/snippets/readme-footer.md",
],
),
"../src/.crate-docs.md": (
for_docs: true,
sections: [
"docs.md",
"https://github.com/khonsulabs/.github/raw/main/snippets/readme-footer.md",
],
),
"../CONTRIBUTING.md": [
"https://github.com/khonsulabs/.github/raw/main/docs/CONTRIBUTING.md",
],
"../CODE_OF_CONDUCT.md": [
"https://github.com/khonsulabs/.github/raw/main/docs/CODE_OF_CONDUCT.md",
],
"../LICENSE-APACHE": [
"https://github.com/khonsulabs/.github/raw/main/licenses/LICENSE-APACHE",
],
"../LICENSE-MIT": [
"https://github.com/khonsulabs/.github/raw/main/licenses/LICENSE-MIT",
],
},
glossaries: [
"https://github.com/khonsulabs/.github/raw/main/snippets/glossary.ron",
{
"msrv": "1.65",
"ref-name": (
default: "main",
release: "v0.1.0",
),
"docs": (
default: "https://khonsulabs.github.io/easing-function/main/easing_function/",
release: "https://docs.rs/easing-function/",
),
"easing": (
default: "https://khonsulabs.github.io/easing-function/main/easing_function/trait.Easing.html",
release: "https://docs.rs/easing-function/*/easing_function/trait.Easing.html",
for_docs: "crate::Easing",
),
"easingfunction": (
default: "https://khonsulabs.github.io/easing-function/main/easing_function/struct.EasingFunction.html",
release: "https://docs.rs/easing-function/*/easing_function/struct.EasingFunction.html",
for_docs: "crate::EasingFunction",
),
"standard": (
default: "https://khonsulabs.github.io/easing-function/main/easing_function/easings/enum.StandardEasing.html",
release: "https://docs.rs/easing-function/*/easing_function/easings/enum.StandardEasing.html",
for_docs: "crate::easings::StandardEasing",
),
"sine": (
default: "https://khonsulabs.github.io/easing-function/main/easing_function/easings/struct.EaseInOutSine.html",
release: "https://docs.rs/easing-function/*/easing_function/easings/struct.EaseInOutSine.html",
for_docs: "crate::easings::EaseInOutSine",
),
},
],
)
49 changes: 49 additions & 0 deletions .rustme/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- This file is generated by `rustme`. Ensure you're editing the source in the .rustme/ directory --!>
<!-- markdownlint-disable first-line-h1 -->

![easing-function is considered alpha](https://img.shields.io/badge/status-alpha-orange)
[![crate version](https://img.shields.io/crates/v/muse.svg)](https://crates.io/crates/easing-function)
[![Documentation for `$ref-name$`](https://img.shields.io/badge/docs-$ref-name$-informational)]($docs$)

A Rusty implementation of easing functions.

## What is an Easing Function?

An easing function is a function that describes how to apply a change of a value
over time. This library's easing functions expect input values between 0.0 and
1.0 and will return values corresponding to that range but may be outside of the
range depending on the function.

Easing functions are typically used in animation systems to customize values
produced between keyframes (tweening).

## Why another easing functions crate?

When creating [Cushy](https://github.com/khonsulabs/cushy), no maintained
library seemed to offer a trait-based solution to allow for custom easing
functions in addition to the standard ones inspired by Robert Penner's original
collection.

## Using this crate

The [`EasingFunction`][easingfunction] type is the central type of this crate. It allows
defining an easing function in two ways:

- [`EasingFunction::from_fn`][from_fn]: Creates an easing function from a `fn(f32) ->
f32` function.
- [`EasingFunction::new`][new]: Creates an easing function from an [`Easing`][easing]
implementor.

This crate also provides the standard set of easing functions in the
[easings][easings] module (e.g., [`EaseInOutSine`][sine]). Finally, the
[`StandardEasings`][standard] enum provides access to the standard easing
functions through an enumeration. This enum also supports `serde` when enabling
the `serde` feature of this crate.

[easing]: $easing$
[easingfunction]: $easingfunction$
[new]: $easingfunction$#method.new
[from_fn]: $easingfunction$#method.from_fn
[sine]: $sine$
[standard]: $standard$

1 change: 1 addition & 0 deletions .rustme/header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# easing-function
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing to our projects

Thank you for your interest in contributing to one of our projects. We want
everyone to have a positive experience contributing, so please carefully review
our only requirements for contributing:

- All contributors must agree to [our Contributor License
Agreement](https://gist.github.com/ecton/b2e1e72abfa122da5e69ed30164f739e).
This will be asked for during your first pull request.
- All contributors must uphold the standards of our [Code of
Conduct](./CODE_OF_CONDUCT.md).

The rest of this document is recommendations/guidelines to help consistency and
communication within our projects.

## Creating Issues

### Reporting Bugs

To us, if something isn't behaving as you expect it to, that's a bug. Even if
it's misbehaving due to a misunderstanding, that means there's an opportunity to
improve our documentation or examples. Please don't hesitate to let us know if
you run into any issues while working with one of our projects.

### Requesting New Features

When requesting new features, please include details about what problem you're
trying to solve, not just a solution to your problem. By helping the community
understand the underlying problem, we can better evaluate what the best solution
to the problem might be.

## Contributing Changes

We openly welcome pull requests on our projects. We don't like bugs, and if
you've found one and wish to submit a fix, we greatly appreciate it.

If you find that fixing a bug requires a significant change, or you are wanting
to add a somewhat large feature, please submit a proposal as an issue first. We
want to make sure that your efforts have the highest chance of success, and a
short discussion before starting can go a long way towards a pull request being
merged with less revisions.

When working on an existing issue, update the issue to reflect that you're
working on it. This will help prevent duplicated efforts.

If you begin working on something but need some assistance, don't hesitate to
reach out inside of the issue, on [our
forums](https://community.khonsulabs.com/), or in [our
Discord](https://discord.khonsulabs.com/). We will do our best to help you.

### Project-specific requirements

Be sure to check if a project's README contains additional contributing
guidelines. Each project may have different tools and commands that should be
run to validate that changes pass all requirements.
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ serde = ["dep:serde"]

[dependencies]
serde = { version = "1.0.208", optional = true, features = ["derive"] }

[lints.clippy]
pedantic = { level = "warn", priority = -1 }
module_name_repetitions = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"

[lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
Loading

0 comments on commit e60e049

Please sign in to comment.