Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions its/ruling/src/test/resources/expected/python-S5332.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,19 @@
],
'project:buildbot-0.8.6p1/buildbot/test/unit/test_status_web_links.py':[
46,
50,
51,
52,
53,
65,
73,
78,
178,
188,
190,
194,
205,
206,
],
'project:buildbot-0.8.6p1/buildbot/test/unit/test_steps_source_bzr.py':[
32,
Expand Down Expand Up @@ -236,6 +243,13 @@
'project:buildbot-0.8.6p1/docs/bbdocs/ext.py':[
154,
],
'project:buildbot-0.8.6p1/docs/conf.py':[
105,
106,
],
'project:buildbot-0.8.6p1/setup.py':[
209,
],
'project:buildbot-slave-0.8.6p1/buildslave/test/unit/test_commands_bk.py':[
37,
49,
Expand All @@ -253,24 +267,30 @@
'project:buildbot-slave-0.8.6p1/buildslave/test/unit/test_commands_hg.py':[
40,
52,
66,
86,
96,
98,
104,
118,
134,
146,
149,
155,
169,
190,
200,
202,
208,
216,
230,
246,
257,
260,
266,
280,
290,
304,
326,
],
'project:buildbot-slave-0.8.6p1/buildslave/test/unit/test_commands_svn.py':[
Expand All @@ -288,6 +308,9 @@
36,
36,
],
'project:buildbot-slave-0.8.6p1/setup.py':[
77,
],
'project:django-2.2.3/django/contrib/contenttypes/views.py':[
41,
],
Expand All @@ -312,6 +335,8 @@
1430,
],
'project:django-2.2.3/django/utils/feedgenerator.py':[
203,
259,
297,
],
'project:django-2.2.3/django/utils/html.py':[
Expand All @@ -320,11 +345,25 @@
'project:docker-compose-1.24.1/compose/config/config.py':[
146,
],
'project:docker-compose-1.24.1/tests/unit/cli/main_test.py':[
160,
],
'project:docker-compose-1.24.1/tests/unit/config/config_test.py':[
4951,
4963,
],
'project:docker-compose-1.24.1/tests/unit/service_test.py':[
860,
862,
888,
890,
894,
896,
936,
966,
968,
979,
980,
1505,
],
'project:numpy-1.16.4/numpy/f2py/setup.py':[
Expand All @@ -347,6 +386,17 @@
56,
],
'project:tornado-2.3/tornado/auth.py':[
106,
108,
110,
117,
127,
129,
131,
134,
135,
136,
145,
180,
181,
182,
Expand Down Expand Up @@ -384,6 +434,7 @@
80,
83,
86,
126,
],
'project:tornado-2.3/tornado/test/httpclient_test.py':[
143,
Expand Down Expand Up @@ -475,6 +526,10 @@
'project:twisted-12.1.0/twisted/lore/topfiles/setup.py':[
23,
],
'project:twisted-12.1.0/twisted/lore/tree.py':[
964,
965,
],
'project:twisted-12.1.0/twisted/mail/topfiles/setup.py':[
38,
],
Expand Down Expand Up @@ -520,6 +575,7 @@
],
'project:twisted-12.1.0/twisted/web/template.py':[
37,
66,
],
'project:twisted-12.1.0/twisted/web/test/test_cgi.py':[
106,
Expand Down Expand Up @@ -596,11 +652,13 @@
2970,
2991,
3039,
3044,
3059,
3071,
3084,
3096,
3112,
3117,
3130,
],
'project:twisted-12.1.0/twisted/web/test/test_xml.py':[
Expand Down Expand Up @@ -637,6 +695,9 @@
'project:twisted-12.1.0/twisted/words/protocols/jabber/xmlstream.py':[
37,
],
'project:twisted-12.1.0/twisted/words/test/test_domish.py':[
348,
],
'project:twisted-12.1.0/twisted/words/test/test_jabbererror.py':[
13,
14,
Expand All @@ -650,4 +711,7 @@
'project:twisted-12.1.0/twisted/words/topfiles/setup.py':[
41,
],
'project:twisted-12.1.0/twisted/words/xish/domish.py':[
29,
],
}
11 changes: 11 additions & 0 deletions its/ruling/src/test/resources/expected/python-S5443.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@
'project:docker-compose-1.24.1/tests/acceptance/cli_test.py':[
2617,
],
'project:docker-compose-1.24.1/tests/integration/project_test.py':[
630,
631,
],
'project:docker-compose-1.24.1/tests/integration/service_test.py':[
284,
303,
448,
706,
],
'project:docker-compose-1.24.1/tests/unit/bundle_test.py':[
114,
135,
],
'project:docker-compose-1.24.1/tests/unit/config/config_test.py':[
840,
1352,
1367,
3116,
3116,
3137,
4306,
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* SonarQube Python Plugin
* Copyright (C) 2011-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.python.api.tree;

import com.sonar.sslr.api.Token;
import java.util.List;

public interface PyDictionaryLiteralTree extends PyExpressionTree {

Token lCurlyBrace();

List<PyKeyValuePairTree> elements();

List<Token> commas();

Token rCurlyBrace();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* SonarQube Python Plugin
* Copyright (C) 2011-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.python.api.tree;

import com.sonar.sslr.api.Token;
import javax.annotation.CheckForNull;

/**
* <pre>
* {@link #key()} {@link #colon()} {@link #value() OR {@link #starStarToken()} {@link #expression()}
* </pre>
*/
public interface PyKeyValuePairTree extends Tree {
@CheckForNull
PyExpressionTree key();

@CheckForNull
Token colon();

@CheckForNull
PyExpressionTree value();

@CheckForNull
Token starStarToken();

@CheckForNull
PyExpressionTree expression();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* SonarQube Python Plugin
* Copyright (C) 2011-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.python.api.tree;

import com.sonar.sslr.api.Token;
import java.util.List;

public interface PySetLiteralTree extends PyExpressionTree {
Token lCurlyBrace();

List<PyExpressionTree> elements();

List<Token> commas();

Token rCurlyBrace();
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,10 @@ public interface PyTreeVisitor {
void visitComprehensionFor(PyComprehensionForTree tree);

void visitComprehensionIf(PyComprehensionIfTree tree);

void visitDictionaryLiteral(PyDictionaryLiteralTree pyDictionaryLiteralTree);

void visitSetLiteral(PySetLiteralTree pySetLiteralTree);

void visitKeyValuePair(PyKeyValuePairTree pyKeyValuePairTree);
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ enum Kind {

CONTINUE_STMT(PyContinueStatementTree.class),

DICTIONARY_LITERAL(PyDictionaryLiteralTree.class),

DEL_STMT(PyDelStatementTree.class),

DOTTED_NAME(PyDottedNameTree.class),
Expand Down Expand Up @@ -113,6 +115,8 @@ enum Kind {

RETURN_STMT(PyReturnStatementTree.class),

SET_LITERAL(PySetLiteralTree.class),

STATEMENT_LIST(PyStatementListTree.class),

STRING_LITERAL(PyStringLiteralTree.class),
Expand Down Expand Up @@ -172,7 +176,9 @@ enum Kind {
UNARY_PLUS(PyUnaryExpressionTree.class),
UNARY_MINUS(PyUnaryExpressionTree.class),
BITWISE_COMPLEMENT(PyUnaryExpressionTree.class),
NOT(PyUnaryExpressionTree.class);
NOT(PyUnaryExpressionTree.class),

KEY_VALUE_PAIR(PyKeyValuePairTree.class);

final Class<? extends Tree> associatedInterface;

Expand Down
Loading