Giter Site home page Giter Site logo

rust-template's Introduction

Rust Template

Environment settings

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install VSCode Extensions

  • crates: Rust package management
  • Even Better TOML: TOML file support
  • Better Comments: Optimized comment display
  • Error Lens: Improved error prompts
  • GitLens: Enhanced Git features
  • Github Copilot: Code suggestions
  • indent-rainbow: Indentation display optimization
  • Prettier - Code formatter: Code formatting tool
  • REST client: REST API debugging tool
  • rust-analyzer:Rust language support
  • Rust Test lens:Rust test support
  • Rust Test Explorer:Rust test overview
  • TODO Highlight:TODO highlighting
  • vscode-icons:Icon optimization
  • YAML:YAML file support

Install cargo generate

cargo generate is a tool for generating project templates. It can use an existing GitHub repo as a template to generate a new project.

cargo install cargo-generate

The new project will use the upupnoah/rust-template template to generate basic code::

cargo generate upupnoah/rust-template

Install pre-commit

pre-commit is a code checking tool that can perform code checks before committing code.

pipx install pre-commit

After successful installation, run pre-commit install.

Install cargo-deny

Cargo deny is a Cargo plugin that can be used to check the security of dependencies.

cargo install --locked cargo-deny

Install typos

Typos is a spell checking tool.

cargo install typos-cli

Install git-cliff

git cliff is a tool for generating changelogs.

cargo install git-cliff

Install cargo nextest

cargo nextest is an enhanced testing tool for Rust.

cargo install cargo-nextest --locked

Template Usage

  1. cargo generate rust-noah/rust-template

  2. Enter the directory, modify the cliff.toml file, change the URL after replace= to your own repository address (you need to create a repository first)

    1. Create an empty repository on GitHub (excluding README, .gitignore, and LICENSE).
    2. cd new-project-dir (Name of the new project)
    3. Execute the command in the empty project created in step 1 (git remote add ...)
  3. pre-commit install

  4. Change the package.name in the Cargo.toml file to the name of the new project.

Note:

  • If git commit encounters problems, please delete deny.toml and then execute cargo deny init

    • Add the code below to licenses.

      unlicensed = "allow"
      allow = [
      "MIT",
      "Apache-2.0",
      "Unicode-DFS-2016",
      "MPL-2.0",
      "BSD-2-Clause",
      "BSD-3-Clause",
      "ISC",
      "CC0-1.0",
      ]

rust-template's People

Contributors

upupnoah avatar

Stargazers

 avatar  avatar

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.