Skip to content

Commit

Permalink
Merge pull request #1 from ekkolon/improve-repo-maintenance
Browse files Browse the repository at this point in the history
Improve repo maintenance
  • Loading branch information
ekkolon authored Dec 1, 2023
2 parents 0c22f07 + d5d4c37 commit 4af815a
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 80

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false
max_line_length = 100

[*.yml]
indent_size = 2
2 changes: 2 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output-type: lcov
output-file: ./lcov.info
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,30 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'

- name: rust-grcov
# You may pin to the exact commit or the version.
# uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248
uses: actions-rs/grcov@v0.1

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
fail_ci_if_error: true
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/target

.cargo/.package-cache
.cargo/bin/
.cargo/env
.cargo/registry/

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.formatOnSave": true,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"target/**": true
},
"search.exclude": {
"target/**": true
}
}
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ keywords = [

[badges]
codecov = { repository = "ekkolon/ogp", branch = "main", service = "github" }
maintenance = { status = "experimental" }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable
8 changes: 8 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
max_width = 80
newline_style = "Unix"
edition = "2021"
use_small_heuristics = "Default"
reorder_imports = true
reorder_modules = true
merge_derives = true
use_field_init_shorthand = true
2 changes: 1 addition & 1 deletion src/metadata/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use serde::{Deserialize, Serialize};

use crate::Result;
use crate::validator::{DimensionsValidator, Validator};
use crate::Result;

/// `Image` contains Open Graph metadata for the `video` metatag(s).
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion src/object_type/book.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//! Metadata utility for the Open Graph `book` meta tag.

// TODO: implementation
// TODO: implementation
2 changes: 1 addition & 1 deletion src/object_type/music.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//! Metadata utility for the Open Graph `music` meta tag.

// TODO: implementation
// TODO: implementation
2 changes: 1 addition & 1 deletion src/object_type/profile.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//! Metadata utility for the Open Graph `profile` meta tag.

// TODO: implementation
// TODO: implementation
3 changes: 2 additions & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
#![allow(dead_code)]

/// A constant array containing the allowed image file extensions.
pub const ALLOWED_MEDIA_FILE_EXT: [&str; 5] = ["png", "jpg", "jpeg", "gif", "webp"];
pub const ALLOWED_MEDIA_FILE_EXT: [&str; 5] =
["png", "jpg", "jpeg", "gif", "webp"];

/// Checks if a given filename has a valid image extension based on a predefined set of allowed extensions.
///
Expand Down

0 comments on commit 4af815a

Please sign in to comment.