Coder Social home page Coder Social logo

rust-github / template Goto Github PK

View Code? Open in Web Editor NEW
181.0 4.0 32.0 90 KB

Template for a generic rust project hosted on GitHub

Home Page: https://rust-github.github.io/

License: MIT License

Rust 100.00%
cargo-generate rust github template hacktoberfest

template's Introduction

Rust Github Template

A template for cargo generate that aims to be a starting point suitable for the vast majority of rust projects that will be hosted on GitHub.

See the project website.

template's People

Contributors

codeman99 avatar dependabot[bot] avatar gifnksm avatar joshrotenberg avatar marcoieni avatar midnightexigent avatar tl-marco-ieni avatar wonderfulspam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

template's Issues

yml error when running cargo generate

cargo generate --git https://github.com/rust-github/template.git
Project Name : app
Creating project called app...
Error: Error replacing placeholders C:\Users\fdemi\AppData\Local\Temp\.tmpyuAG9z\.github\workflows\build.yml

Caused by:
liquid: Unknown variable
with:
requested variable=env


Have tried this within -
a git bash embedded in VScode with everything up to date.
a power shell with Windows Development environment established
an elevated Powershell

Nothing worked

Frank

Distinguish between library and binary

When you run cargo generate the user says if the crate is a binary or a library.

If it is a library, then crate a lib.rs file instead of a main.rs file.
Furthermore, the publish job from the cd doesn't have to be generated (You need to generate the cargo publish step only).

issue template: ask if the user wants to fix

Motivations

I noticed that babel asks in the issue template if you would like to work on the fix.
I think that this might be very nice because it's a question that I always ask after an issue has been reported, so maybe it would be useful for others, too.

Solution

With respect to the babel solution, I don't like the fact that the checkbox is interpreted as a task by github, so maybe I would just add the question to be answered in plain text (maybe with a [y/n]) after the question

Template of .github/workflows/cd.yml did not render.

Executed

$ cargo generate --bin --name example rust-github/template
 Favorite `rust-github/template` not found in config, using it as a git repository: https://github.com/rust-github/template.git
 Destination: /home/vscode/example ...
 project-name: example ...
 Generating template ...
 GitHub username (or organization): CodeMan99
 Project description: Example
 Moving generated files into: `/home/vscode/example`...
 Initializing a fresh Git repository
 Done! New project created /home/vscode/example

Problem

The https://github.com/rust-github/template/blob/main/template/.github/workflows/cd.yml file appears as-is without any interpolation of values.

Context

HEAD

This repository is 1af92ab.

cargo-generate --version

I install version 0.18.5 via cargo install --locked cargo-generate.

Failed to parse string when running job[Coveralls]

Run coverallsapp/github-action@master
  with:
    github-token: ***
    path-to-lcov: ./lcov.info
    coveralls-endpoint: https://coveralls.io
  env:
    CACHE_ON_FAILURE: false
    CARGO_INCREMENTAL: 0
Using lcov file: ./lcov.info
Error:  "[2](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:2)022-08-02T09:11:[3](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:3)3.[7](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:7)7[8](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:8)Z"  'error from lcovParse: ' 'Failed to parse string'
Error:  "2022-08-02T0[9](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:10):11:33.779Z"  'input: ' ''
Error:  "2022-08-02T09:[11](https://github.com/pplmx/ip-tools/runs/7628225107?check_suite_focus=true#step:6:12):33.779Z"  'error from convertLcovToCoveralls'
Error: Failed to parse string

Remove the need of example-synchronizer

Motivations

example-synchronizer periodically pulls this repo and pushes changes to the example if there are any.

This is not ideal, in fact a better solution will be to just push changes when there is one.

Solution

cargo generate recently introduced the possibility to have templates as a subdirectory of the repository.
In this way we can have the CI of example synchronizer in the top directory of this repo and we can move the whole template in a subdirectory (called template for example).
Also add a minimal readme that points to https://rust-github.github.io/

Additional context

If you get permissions issues in the CI while trying to push to rust-gh-example, I might need to add the secret token in this repo. Let's see.

add `description` to `cargo-generate.toml`

Problem

Cargo.toml description field is mandatory in order to publish the crate on crates.io.

Solution

We should ask it as input to the user when he generates this template.

Please, add a default value also here

automatic example update

Right now the example has to be updated manually.

Do you know a way to update it automatically?

We can't add special github actions here or in the example repo, because otherwise they will conflict with the template.

Maybe there could be another repo that periodically checks for updates on this repo and pushes changes automatically to the example repo?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.