Giter Club home page Giter Club logo

eunomia's Introduction

open-rust-initiative

eunomia's People

Contributors

genedna avatar j-zhengli avatar kiscad avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eunomia's Issues

Implement `RulesConfig` struct for parsing

The app needs to read a local config file from the user, which will be a JSON file.

Remember to add tests for parsing to ensure each config option will be de-serialized into the struct.

implement a mechanism that allows user to temporarily ignore a specific check result

Summary

Currently, eunomia checks code by invoking other tools such as clippy, sanitizer etc.

Therefore, there will be false positive cases almost for certain. If the problematic code can be detected by rustc/clippy lints, users could just add a allow[xxx] to ignore it. But if it was detected by other tools that doesn't have such control, then the output will contains a false positive error result, this might cause a huge problem if eunomia was set in some project's ci and causing it to fail.

In that case, we need a mechanism to ignore potential false positive results, this could be done by reading a configuration file from src code root directory (such as clippy.toml);
Or, read the source file that have specific attribute macro (such as #[cfg(eunomia)]) with another attributes such as #[eunomia(allow = "xxxxx")] to ignore a case called xxxxx for the next line of code.

The first method should be more achiveable, since some check result might not even have a line information, not to mention some of the result (specifically the output of lint check in clippy::cargo group) cannot be controlled by the second method.

Add dogfood test for this project

this includes dogfood tests, meaning that we need to be able to:

  1. compile this tool
  2. run this tool, on the source code of this tool ๐Ÿคฃ

code formatting check in ci

simply adding an option to run cargo fmt --check --all to github action should do the trick,
and it would really help improving the quality of the code base imo.

Implement argument parser to handle command line options

Using clap at this stage is preferred, since we might not have enough time to implement it on our own, but do note that we might need to ditch clap in the future, so try to make the design less clap-dependent. Therefore, using a struct with its derive macro is preferable, and if we want to implement argparser in our own we don't need to change much of the existing syntax.

Basic option to implement:

1. -h|--help: show a help messages describe what this tool does and for each command options.
2. -V|--version: show the current app version.
3. --rule-file <FILE>: set the path to the checks configuration file, which needs to be an existing file.
4. --src-file <FILE>: set the path to the source code file that needs to be checked.
5. --output <PATH>: set the path to the output file, doesn't need to exist as the program will attempt to create one.

implement checking for `sanitizer`

basically runs cargo build, or build a certain rust file with rustc with the option defined in ClippyOpt, and collect output from it.

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.