GithubHelp home page GithubHelp logo

sonar-checks's People

Contributors

bzz avatar juanjux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sonar-checks's Issues

Error while importing bblfsh_sonar_checks.util package

while implementing one of the rules in python we were using bblfsh_sonar_checks.util package. It throws following error -
root@ip-172-31-34-50:~/sourced/git/source-d/Python# python3 if_duplicate_rule.py
Traceback (most recent call last):
File "if_duplicate_rule.py", line 1, in
import bblfsh_sonar_checks.utils as utils
File "/usr/local/lib/python3.5/dist-packages/bblfsh_sonar_checks/init.py", line 1, in
from bblfsh_sonar_checks.utils import (
File "/usr/local/lib/python3.5/dist-packages/bblfsh_sonar_checks/utils.py", line 47
self.modifiers: List[str] = []
^
SyntaxError: invalid syntax

Always output a valid JSON

All the rules output what looks like JSON ๐Ÿš€ but

python3 -m bblfsh_sonar_checks --language=java \
    | --enable=RSPEC-1143 \
    | ./bblfsh_sonar_checks/fixtures/java/RSPEC-1143.java \
    | jq '.RSPEC-1143'

results in parse error: Invalid numeric literal at line 1, column 14.

RSPEC-1143: false positive, throw \wo finaly

A bit confused by findings of RSPEC-1143.

$ python3 -m bblfsh_sonar_checks --language=java --enable=RSPEC-1143 ./bblfsh_sonar_checks/fixtures/java/RSPEC-1143.java

on modified .java

class ThrowInFinally {
    void test() {
        try {
        } finally {
            throw new RuntimeException();
            return;
        }
    }
    void test2() {
        throw new RuntimeException();
    }
}

report 3 findings, although according to RSPEC-1143 it seems like it should report only 2 messages for single jump statement inside finally block.

Full output in details

{'RSPEC-1143': [{'msg': "Don't throw or return inside a finally (line {})",
                 'pos': offset: 87
line: 5
col: 13
},
                {'msg': "Don't throw or return inside a finally (line {})",
                 'pos': offset: 129
line: 6
col: 13
},
                {'msg': "Don't throw or return inside a finally (line {})",
                 'pos': offset: 180
line: 10
col: 9
}]}

Feature request: automated publishing on pypi + description

One can see https://pypi.org/project/bblfsh_sonar_checks/ ๐ŸŽ‰ but it would be also supe-useful to publish on pypi as a part of release process, a newer versions e.g. https://github.com/bblfsh/sonar-checks/releases/tag/v0.2.0 of this library, that exposes

  • run_check(check, lang, uast)
  • list_checks(lang)

and has package description instead of The author of this package has not provided a project description with simple example of calling this API

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.