Git Product home page Git Product logo

souffle-lint's Introduction

souffle-lint's People

Contributors

langston-barrett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

souffle-lang

souffle-lint's Issues

doc: Contributing rules

The documentation should have a section on how to contribute rules. It should cover benchmarking them on the files in bench/, link to the grammar, remind about rule categories, and link to sections on writing rules, building from source, and writing tests with lit.

Use `#line` directives

These come from the C pre-processor and would help users who must pre-process their Datalog get accurate/useful filenames and line numbers.

Configuration management

It would be great if each CLI option had a corresponding entry in the configuration file and a corresponding environment variable, all with the correct precedence. There may be a helpful library out there for this.

rule: Simplify union type

e.g.

.type T = S | symbol

should just be

.type T = symbol

and

.type T = S | R | S

should be

.type T = S | R

and

.type T = S | R
.type Q = T | S | P

should be

.type T = S | R
.type Q = T | P

rule: Unused variable

souffle-lint could probably detect some very limited instances of unused variables, e.g., rules with nullary heads and only one clause:

f() :- g(x).

doc: Don't recommend pre-processing

Leads to false positives in the simpl- rules, and the parser is robust to parse errors so it's not really a big problem. Also, don't warn/error on parse errors by default.

JSON output

Add a JSON output format for logs to make it easier to integrate souffle-lint with other tools.

doc: Include list of default rules

The documentation build (conf.py) should run a Python script that reads config/default.yml and formats it nicely as an ReST page to be included in the documentation, a la souffle-lint info.

Warn on parse errors

tree-sitter parsers are robust to errors, so they still produce a syntax tree even if there's a problem. We should have an option to emit a warning if there are any parse errors.

Add more context for errors

anyhow allows you to attach context to errors with the .context and .with_context methods. More of the errors in souffle-lint should have context!

rule: Simplify comparison

e.g., instead of

f() :- x = 5; x < 5.

write

f() :- x <= 5.

or instead of

f() :- x <= 5, x != 5.

write

f() :- x < 5.

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.