Update to version 1.0.0

This commit is contained in:
ElBe
2023-10-24 09:33:46 +02:00
commit 0dcaf740aa
40 changed files with 1864 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
[general]
ignore=B6
+2
View File
@@ -0,0 +1,2 @@
# Global owner
* @ElBe-Plaq
+121
View File
@@ -0,0 +1,121 @@
# 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 on
[our discord server](https://discord.gg/JVyyDukQqV).
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](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html),
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](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).
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at
[https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
+29
View File
@@ -0,0 +1,29 @@
# How to contribute to this project
Did you find a bug? You want to have a feature implemented? You made code better?
Please follow the instructions below on how to contribute to this project.
## Notes
Please do **not** report an issue of pull request if the issue is a security vulnerability.
There is a different way to report such issues. Issues or pull requests about a vulnerability will be removed.
<div style="text-align: center">
<h4>Report vulnerabilities <a href="https://github.com/ElBe-Development/logging-rs/security/advisories/new">here</a></h4>
</div>
## Contributing
For any issues or proposals, open an issue. If you already wrote your proposed change(s), please open an issue
and a pull request. See below for making changes on your own.
### Making changes on your own
1. Create a new issue with a summary of your proposed changes and more.
2. Fork the repository.
3. Implement your changes
4. Test your changes. Run `cargo fmt`, `cargo check` and `cargo clippy` to verify it works.
5. Create a pull request from your fork.
6. If it gets accepted, your changes will be in the next release.
To everyone who has reported issues, proposed changes or just helped with peoples questions: Thank you!
+2
View File
@@ -0,0 +1,2 @@
---
ko_fi: elbeplaq
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] TITLE"
labels: Bug
assignees: ElBe-Plaq
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Rust version [eg. 1.69]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+6
View File
@@ -0,0 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: Discord Server
url: https://discord.gg/JVyyDukQqV
about: Please ask and answer questions here or just chat with the communtiy.
+7
View File
@@ -0,0 +1,7 @@
---
name: Documentation
about: Improvements to the documentation.
title: "[DOCUMENTATION] TITLE"
labels: Documentation
assignees: ElBe-Plaq
---
+7
View File
@@ -0,0 +1,7 @@
---
name: Enhancement
about: Improves something already existing.
title: "[ENHANCEMENT] TITLE"
labels: Enhancement
assignees: ElBe-Plaq
---
+19
View File
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE] TITLE"
labels: Feature request
assignees: ElBe-Plaq
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+26
View File
@@ -0,0 +1,26 @@
# Description
Summary of all the changes made.
Closes #(issues that get closed, if this pull request gets closed)
## Type of change
<!-- Select the relevant option(s) -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Something else
# Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new errors or linter warnings
- [ ] My changes generate no problems with other code
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing tests passed locally with my changes
+86
View File
@@ -0,0 +1,86 @@
<h1 align="center">
logging-rs
</h1>
<h3 align="center">
logging-rs helps you add logging to your projects using simple macros.
</h3>
<p align="center">
<img src="https://img.shields.io/crates/v/logging-rs">
<img src="https://www.codefactor.io/repository/github/ElBe-Development/logging-rs/badge">
<img src="https://github.com/ElBe-Development/logging-rs/actions/workflows/megalinter.yml/badge.svg?branch=main&event=push">
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit">
</p>
<img src="https://github.com/ElBe-Development/logging-rs/blob/main/.github/example.png?raw=true"/>
## About this project
logging-rs helps you add logging to your projects using simple macros.
## Installing
Run the following command to add the package to your dependencies:
```bash
$ cargo add logging-rs
...
```
### Git
To clone the repository locally using git run `git clone https://github.com/ElBe-Development/logging-rs.git`.
## Usage
To use logging-rs you need a configuration. It's best to keep it the same across multiple files. You then need to follow these steps:
1. Import the logging-rs crate:
```rust,ignore
use logging_rs;
```
2. Create a new logger object:
```rust,ignore
let logger = logging_rs::Logger::new(logging_rs::Formatter::default(), vec![logging_rs::Output::STDOUT]);
```
3. Log the messages you want to log:
```rust,ignore
logging_rs::debug!(logger, "Debug message");
logging_rs::info!(logger, "Info");
logging_rs::warn!(logger, "Warning");
logging_rs::error!(logger, "Error!");
logging_rs::fatal!(logger, "Fatal error!");
logging_rs::log!(logger, "Log message");
```
## Example
With the following rust code:
```rust,ignore
use logging_rs;
fn main() {
let logger = logging_rs::Logger::default();
logging_rs::debug!(logger, "Debug message");
}
```
You will get the following output:
```bash
[TIMESTAMP] [DEBUG] src\main.rs: Debug message
```
Where `TIMESTAMP` is the current timestamp.
## Contact
To contact us, get help or just chat with others, you can visit [our discord server](https://discord.gg/JVyyDukQqV).
+14
View File
@@ -0,0 +1,14 @@
# Security Policy
## Supported Versions
| Version | Supported |
| -------- | ------------------ |
| `v1.0.0` | :white_check_mark: |
## Reporting a Vulnerability
To report a vulnerability, go to [our discord server](https://discord.gg/JVyyDukQqV), write an
[E-Mail](mailto:elbe.dev.plaq@gmail.com) or report it via
[GitHubs security reporting system](https://github.com/ElBe-Development/logging-rs/security/advisories/new)
(preferred).
+7
View File
@@ -0,0 +1,7 @@
# Support
You can get support on:
- [our discord server](https://discord.gg/JVyyDukQqV)
- [GitHub discussions](https://github.com/ElBe-Development/logging-rs/discussions)
- [GitHub issues](https://github.com/ElBe-Development/logging-rs/issues)
+5
View File
@@ -0,0 +1,5 @@
---
addReviewers: false
addAssignees: true
assignees:
- ElBe-Plaq
+33
View File
@@ -0,0 +1,33 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
---
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
assignees:
- "ElBe-Plaq"
labels:
- "dependencies"
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
assignees:
- "ElBe-Plaq"
labels:
- "dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
assignees:
- "ElBe-Plaq"
labels:
- "dependencies"
+3
View File
@@ -0,0 +1,3 @@
# errors module
Module for dealing with errors.
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+5
View File
@@ -0,0 +1,5 @@
---
example:
- "examples/*"
dependencies:
- "dev-requirements.txt"
+128
View File
@@ -0,0 +1,128 @@
---
pull_request_rules:
- name: Merge trusted bot updates, no conflicts are present and approved
conditions:
- or:
- "label~=Approved"
- "-#approved-reviews-by=0"
- "-conflict"
- "-draft"
- "-locked"
- "#check-failure=0"
- "author~=.*bot.*"
actions:
comment:
message: |
# Merging pull request
Checks:
| Name | Status |
|------|--------|
{% for check in check_success %}| {{check}} | :white_check_mark: |
{% endfor %}
merge:
commit_message_template: |
{{title}}
{{title}} in #{{number}} by @{{author}}, contributing to {{milestone}}
Changed files:
{% for file in files %}- '{{file}}'
{% endfor %}
Approved by: @{{ approved_reviews_by | join(', @') }}
{% for commit in commits %}Co-authored-by: {{commit.author}} <{{commit.email_author}}>
{% endfor %}
method: merge
delete_head_branch:
- name: Merge if approved, no conflicts are present and it's not a WIP
conditions:
- or:
- "-#approved-reviews-by=0"
- "label~=Approved"
- "label~=Able to merge"
- "-conflict"
- "-draft"
- "-locked"
- "#check-failure=0"
actions:
comment:
message: |
# Merging pull request
Checks:
| Name | Status |
|------|--------|
{% for check in check_success %}| {{check}} | :white_check_mark: |
{% endfor %}
merge:
commit_message_template: |
{{title}}
{{title}} in #{{number}} by @{{author}}, contributing to {{milestone}}
Changed files:
{% for file in files %}- '{{file}}'
{% endfor %}
Approved by: @{{ approved_reviews_by | join(', @') }}
{% for commit in commits %}Co-authored-by: {{commit.author}} <{{commit.email_author}}>
{% endfor %}
method: merge
delete_head_branch:
- name: Add review requested label and request review from ElBe
conditions:
- or:
- "#approved-reviews-by=0"
- "-label~=Approved"
- "-title~=^[WIP].*"
- "-label~=Declined"
- "-label~=Review requested"
- "-draft"
- "-locked"
- "-conflict"
actions:
label:
add:
- Review requested
request_reviews:
users:
- ElBe-Plaq
- name: Warn on conflicts and add label
conditions:
- conflict
actions:
comment:
message: "@{{author}} this pull request has one or more conflicts."
label:
add:
- Invalid
remove:
- Review requested
- name: Remove invalid label if not needed
conditions:
- -conflict
actions:
label:
add:
- Review requested
remove:
- Invalid
- name: Warn on failed checks
conditions:
- "-#check-failure=0"
actions:
comment:
message: |
# Checks failed
Checks:
| Name | Status |
|------|--------|
{% for check in check_success %}| {{check}} | :white_check_mark: |
{% endfor %}{% for check in check_failure %}| {{check}} | :x: |
{% endfor %}
+11
View File
@@ -0,0 +1,11 @@
---
daysUntilStale: 60
daysUntilClose: 7
exemptLabels:
- Security
staleLabel: stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
closeComment: false
+14
View File
@@ -0,0 +1,14 @@
name: Codecov
permissions: read-all
on:
[push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+46
View File
@@ -0,0 +1,46 @@
---
name: Dependencies
permissions: read-all
on:
push:
paths: ["dev-requirements.txt", "Cargo.toml"]
pull_request:
paths: ["dev-requirements.txt", "Cargo.toml"]
jobs:
install-python-dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies from txt files
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
install-rust-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies from Cargo.toml
run: cargo update
- name: Install dev-dependencies from Cargo.toml
run: cargo test --no-run
# ^ This is the only way to install dev-dependencies
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
if: ${{ github.event_name != 'push' }}
- name: Dependency Review
if: ${{ github.event_name != 'push' }}
uses: actions/dependency-review-action@v3
+25
View File
@@ -0,0 +1,25 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler
---
name: Labeler
permissions:
pull-requests: write
on: [pull_request_target]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
+38
View File
@@ -0,0 +1,38 @@
---
name: MegaLinter
permissions: read-all
on:
push:
pull_request:
branches: [main]
env:
APPLY_FIXES: VALIDATE_ALL_CODEBASE
APPLY_FIXES_EVENT: all
APPLY_FIXES_MODE: commit
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: MegaLinter
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: MegaLinter
id: ml
uses: oxsecurity/megalinter@v7
env:
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+18
View File
@@ -0,0 +1,18 @@
name: Rust
permissions: read-all
on:
[push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose