A Linter for bevy code

Overview

Bevy Lint

What is Bevy Lint?

This crates provides Lints for Bevy Code using dylint.

How to run Lints

Add this to your Cargo.toml:

[workspace.metadata.dylint]
libraries = [
    { git = "https://github.com/MinerSebas/bevy_lint", branch = "main" },
]

Instead of a branch, you can also provide a tag or a rev (revision)

Afterwards you need to run these commans:

cargo install cargo-dylint dylint-link    # Only neccesary once
cargo dylint bevy_lint

If you are using the MSVC Toolchain, you will need to manualy build dylint from Source, until https://github.com/trailofbits/dylint/pull/45 is merged and released.

git clone https://github.com/MinerSebas/dylint
cd dylint
git checkout linker
cargo install --path cargo-dylint
cargo install --path dylint-link

Lint Creation

A Lint is created by implementing the LateLintPass trait and adding to the register_lints function.

When creating a UI Test, add the Test as an Example to the Cargo.toml. Also make sure that your .stderr File uses LF Line-endings and not CRLF, as otherwise the Test will fail without any explanation.

For more Resources you can take a look at the dylint resources.

License

bevy_lint is free and open source! All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
A Faster(⚡)  formatter, linter, bundler, and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS Lapce Plugin
A Faster(⚡) formatter, linter, bundler, and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS Lapce Plugin

Lapce Plugin for Rome Lapce-rome is a Lapce plugin for rome, The Rome is faster ⚡ , A formatter, linter, compiler, bundler, and more for JavaScript, T

The JavaScript Oxidation Compiler - Linter / Prettier

The JavaScript Oxidation Compiler (oxc) Why this project? The goal of this project is to: Create a blazingly fast JavaScript Compiler written in Rust.

Opinionated, zero-config linter for JavaScript monorepos
Opinionated, zero-config linter for JavaScript monorepos

Sherif: Opinionated, zero-config linter for JavaScript monorepos About Sherif is an opinionated, zero-config linter for JavaScript monorepos. It runs

The non-opinionated Rust-based commit message linter.
The non-opinionated Rust-based commit message linter.

Documentation | Website git-sumi The non-opinionated Rust-based commit message linter Transform your commit practices with flexible linting for consis

Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

A example bevy application using bevy-kajiya for its renderer
A example bevy application using bevy-kajiya for its renderer

☀️ bevy-kajiya playground A example bevy application using bevy-kajiya for its renderer NOTE: only tested on Windows. For more context, check out the

bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Examples inspired by 'Nature of Code' in Bevy 3D and Rust
Examples inspired by 'Nature of Code' in Bevy 3D and Rust

rust-bevy and the Nature of Code The book The Nature of Code from Daniel Shiffman is a wonderful book about programming. https://natureofcode.com/book

deductive verification of Rust code. (semi) automatically prove your code satisfies your specifications!
deductive verification of Rust code. (semi) automatically prove your code satisfies your specifications!

Le marteau-pilon, forges et aciéries de Saint-Chamond, Joseph-Fortuné LAYRAUD, 1889 About Creusot is a tool for deductive verification of Rust code. I

An inquiry into nondogmatic software development. An experiment showing double performance of the code running on JVM comparing to equivalent native C code.
An inquiry into nondogmatic software development. An experiment showing double performance of the code running on JVM comparing to equivalent native C code.

java-2-times-faster-than-c An experiment showing double performance of the code running on JVM comparing to equivalent native C code ⚠️ The title of t

unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

Generate QR code easily for free - QR Code Generation as a Service.

QRcode.show Generate QR code easily for free - QR Code Generation as a Service. INPUT: curl qrcode.show/INPUT curl qrcode.show -d INPUT curl qrcode.sh

m2cgen (Model 2 Code Generator) - is a lightweight library which provides an easy way to transpile trained statistical models into a native code

Transform ML models into a native code (Java, C, Python, Go, JavaScript, Visual Basic, C#, R, PowerShell, PHP, Dart, Haskell, Ruby, F#, Rust) with zero dependencies

A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)
A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)

iro -色- A CLI tool to convert the hex color code or RGB to color code, RGB, HSL, color name(if exists, according to jonathantneal/color-names). Usage

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!
languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments! Overview Install MacO

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code. It accepts a local path to a folder containing code, and generates a review for each file in the folder and its subdirectories.

Comments
  • Check for String Labels

    Check for String Labels

    Using strings as Labels allows typos:

    App::new()
    	.add_system(some_system.label("some_label"))
    	.add_system(other_system.after("some_lobel")) // Label with typo
    

    Instead, a user should use an Enum/Unit Struct that derives the Label:

    #[derive(Debug, Hash, PartialEq, Eq, Clone, SystemLabel)]
    struct SomeLabel;
    
    App::new()
    	.add_system(some_system.label(SomeLabel))
    	.add_system(other_system.after(SomeLabel))
    

    This should check for all kinds of Labels:

    enhancement 
    opened by MinerSebas 2
  • Multiple Labels for one Type

    Multiple Labels for one Type

    Check for Types that implement multiple Label Traits.

    #[derive(Debug, Hash, PartialEq, Eq, Clone, SystemLabel, AmbiguitySetLabel)]
    struct SomeLabel;
    
    App::new()
    	.add_system(some_system.label(SomeLabel))
    	.add_system(conflicting_system.in_ambiguity_set(SomeLabel)) // Will still report ambiguity.
    

    Use instead:

    #[derive(Debug, Hash, PartialEq, Eq, Clone, SystemLabel)]
    struct SomeSystemLabel;
    #[derive(Debug, Hash, PartialEq, Eq, Clone, AmbiguitySetLabel)]
    struct SomeAmbiguityLabel;
    
    App::new()
    	.add_system(some_system.label(SomeSystemLabel).in_ambiguity_set(SomeAmbiguityLabel))
    	.add_system(conflicting_system.in_ambiguity_set(SomeAmbiguityLabel))
    

    This should check for all kinds of Labels:

    enhancement 
    opened by MinerSebas 1
  • Lint for invalid overlapping data access

    Lint for invalid overlapping data access

    To follow Rust's mutability Rules, Bevy dissallows usage of systems that would break them:

    fn resource_system(res: Res<A>, res_mut: ResMut<A>) {}
    fn query_system(query: Query<&B>, query_mut: Query<&mut B>) {}
    

    Sadly Bevy can only check this at runtime, where it panics if it finds any conflict.

    bevy_lint should Lint systems, to provide a check at "compile-time".

    enhancement 
    opened by MinerSebas 0
Owner
null
A cryptographically verifiable code review system for the cargo (Rust) package manager.

image credit cargo-crev A cryptographically verifiable code review system for the cargo (Rust) package manager. Introduction Crev is a language and ec

crev - Code REView system 1.8k Jan 5, 2023
Source code spell checker

eztd is meant to close the ergonomics gap between Rust and Python.

Ed Page 9 Aug 14, 2022
loc is a tool for counting lines of code. It's a rust implementation of cloc, but it's more than 100x faster.

2019-10-07: I really haven't been on top of accepting pull requests or looking at issues, you guy should definitely look at SCC. It's faster and more

cgag 2.1k Jan 2, 2023
A Linter for bevy code

Bevy Lint What is Bevy Lint? This crates provides Lints for Bevy Code using dylint.

null 39 Dec 21, 2022
⚡️Lightning-fast linter for .env files. Written in Rust 🦀

⚡️ Lightning-fast linter for .env files. Written in Rust ?? Dotenv-linter can check / fix / compare .env files for problems that may cause the applica

null 1.5k Jan 9, 2023
Lintje is an opinionated linter for Git.

Lintje Lintje is an opinionated linter for Git. It lints commit messages based on a preconfigured set of rules focussed on promoting communication bet

Tom de Bruijn 26 Dec 18, 2022
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

Rome 22k Jan 3, 2023
Blazing fast linter for JavaScript and TypeScript written in Rust

deno_lint A Rust crate for writing fast JavaScript and TypeScript linters. This crate powers deno lint, but is not Deno specific and can be used to wr

Deno Land 1.3k Dec 29, 2022
A fast, customizable, and easy to use JavaScript and TypeScript linter

RSLint A fast, customizable, and easy to use JavaScript and TypeScript linter Guide | Contributing | Website | Linter Rules ⚠️ RSLint is in early deve

RSLint 2.4k Jan 1, 2023
An extremely fast Python linter, written in Rust.

Ruff An extremely fast Python linter, written in Rust. Linting the CPython codebase from scratch. ⚡️ 10-100x faster than existing linters ?? Installab

Charlie Marsh 5.1k Dec 30, 2022