Skip to content

Commit f4fc282

Browse files
committed
Update according to linter, formatter and license checker.
1 parent 607a923 commit f4fc282

20 files changed

+836
-458
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/Python3Core.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,27 @@
2525
*/
2626
package com.oracle.graal.python.builtins;
2727

28+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.IndentationError;
29+
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.TabError;
30+
import static com.oracle.graal.python.nodes.BuiltinNames.PRINT;
31+
import static com.oracle.graal.python.nodes.SpecialAttributeNames.__PACKAGE__;
32+
import static com.oracle.graal.python.runtime.exception.PythonErrorType.SyntaxError;
33+
34+
import java.io.IOException;
35+
import java.math.BigInteger;
36+
import java.util.ArrayList;
37+
import java.util.Arrays;
38+
import java.util.HashMap;
39+
import java.util.List;
40+
import java.util.Map;
41+
import java.util.Map.Entry;
42+
import java.util.ServiceLoader;
43+
import java.util.logging.Level;
44+
import java.util.regex.Matcher;
45+
import java.util.regex.Pattern;
46+
47+
import org.graalvm.nativeimage.ImageInfo;
48+
2849
import com.oracle.graal.python.PythonLanguage;
2950
import com.oracle.graal.python.builtins.modules.ArrayModuleBuiltins;
3051
import com.oracle.graal.python.builtins.modules.AtexitModuleBuiltins;
@@ -262,26 +283,6 @@
262283
import com.oracle.truffle.api.nodes.RootNode;
263284
import com.oracle.truffle.api.source.Source;
264285
import com.oracle.truffle.api.source.SourceSection;
265-
import org.graalvm.nativeimage.ImageInfo;
266-
267-
import java.io.IOException;
268-
import java.math.BigInteger;
269-
import java.util.ArrayList;
270-
import java.util.Arrays;
271-
import java.util.HashMap;
272-
import java.util.List;
273-
import java.util.Map;
274-
import java.util.Map.Entry;
275-
import java.util.ServiceLoader;
276-
import java.util.logging.Level;
277-
import java.util.regex.Matcher;
278-
import java.util.regex.Pattern;
279-
280-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.IndentationError;
281-
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.TabError;
282-
import static com.oracle.graal.python.nodes.BuiltinNames.PRINT;
283-
import static com.oracle.graal.python.nodes.SpecialAttributeNames.__PACKAGE__;
284-
import static com.oracle.graal.python.runtime.exception.PythonErrorType.SyntaxError;
285286

286287
/**
287288
* The core is intended to the immutable part of the interpreter, including most modules and most

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/PythonBuiltinClassType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,8 @@ public final Shape getInstanceShape(PythonLanguage lang) {
702702

703703
HashSet<String> set = new HashSet<>();
704704
for (PythonBuiltinClassType type : VALUES) {
705-
assert set.add("" + type.moduleName + "." + type.name) : type.name(); // check uniqueness
705+
// check uniqueness
706+
assert set.add("" + type.moduleName + "." + type.name) : type.name();
706707

707708
/* Initialize type.base (defaults to PythonObject unless that's us) */
708709
if (type.base == null && type != PythonObject) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/csv/CSVDialect.java

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* The Universal Permissive License (UPL), Version 1.0
6+
*
7+
* Subject to the condition set forth below, permission is hereby granted to any
8+
* person obtaining a copy of this software, associated documentation and/or
9+
* data (collectively the "Software"), free of charge and under any and all
10+
* copyright rights in the Software, and any and all patent rights owned or
11+
* freely licensable by each licensor hereunder covering either (i) the
12+
* unmodified Software as contributed to or provided by such licensor, or (ii)
13+
* the Larger Works (as defined below), to deal in both
14+
*
15+
* (a) the Software, and
16+
*
17+
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
* one is included with the Software each a "Larger Work" to which the Software
19+
* is contributed by such licensors),
20+
*
21+
* without restriction, including without limitation the rights to copy, create
22+
* derivative works of, display, perform, and distribute the Software and make,
23+
* use, sell, offer for sale, import, export, have made, and have sold the
24+
* Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
* either these or other terms.
26+
*
27+
* This license is subject to the following condition:
28+
*
29+
* The above copyright notice and either this complete permission notice or at a
30+
* minimum a reference to the UPL must be included in all copies or substantial
31+
* portions of the Software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
* SOFTWARE.
40+
*/
141
package com.oracle.graal.python.builtins.modules.csv;
242

343
import static com.oracle.graal.python.builtins.modules.csv.CSVModuleBuiltins.NOT_SET;
@@ -7,18 +47,18 @@
747
import com.oracle.truffle.api.object.Shape;
848

949
public final class CSVDialect extends PythonBuiltinObject {
10-
String delimiter; /* field separator */
11-
boolean doubleQuote; /* is " represented by ""? */
12-
String escapeChar; /* escape character */
13-
String lineTerminator; /* string to write between records */
14-
QuoteStyle quoting; /* style of quoting to write */
15-
String quoteChar; /* quote character */
16-
boolean skipInitialSpace; /* ignore spaces following delimiter? */
17-
boolean strict; /* raise exception on bad CSV */
50+
String delimiter; /* field separator */
51+
boolean doubleQuote; /* is " represented by ""? */
52+
String escapeChar; /* escape character */
53+
String lineTerminator; /* string to write between records */
54+
QuoteStyle quoting; /* style of quoting to write */
55+
String quoteChar; /* quote character */
56+
boolean skipInitialSpace; /* ignore spaces following delimiter? */
57+
boolean strict; /* raise exception on bad CSV */
1858

19-
int delimiterCodePoint; /* code point representation for handling utf-32 delimiters */
20-
int escapeCharCodePoint; /* code point representation for handling utf-32 escape chars */
21-
int quoteCharCodePoint; /* code point representation for handling utf-32 quote chars */
59+
int delimiterCodePoint; /* code point representation for handling utf-32 delimiters */
60+
int escapeCharCodePoint; /* code point representation for handling utf-32 escape chars */
61+
int quoteCharCodePoint; /* code point representation for handling utf-32 quote chars */
2262
int[] lineTerminatorCodePoints; /*
2363
* code point representation for handling utf-32 chars in line
2464
* terminator
@@ -29,8 +69,8 @@ public CSVDialect(Object cls, Shape instanceShape) {
2969
}
3070

3171
public CSVDialect(Object cls, Shape instanceShape, String delimiter, boolean doubleQuote, String escapeChar,
32-
String lineTerminator, String quoteChar, QuoteStyle quoting, boolean skipInitialSpace,
33-
boolean strict) {
72+
String lineTerminator, String quoteChar, QuoteStyle quoting, boolean skipInitialSpace,
73+
boolean strict) {
3474
super(cls, instanceShape);
3575
this.delimiter = delimiter;
3676
this.doubleQuote = doubleQuote;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/csv/CSVDialectBuiltins.java

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
1+
/*
2+
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* The Universal Permissive License (UPL), Version 1.0
6+
*
7+
* Subject to the condition set forth below, permission is hereby granted to any
8+
* person obtaining a copy of this software, associated documentation and/or
9+
* data (collectively the "Software"), free of charge and under any and all
10+
* copyright rights in the Software, and any and all patent rights owned or
11+
* freely licensable by each licensor hereunder covering either (i) the
12+
* unmodified Software as contributed to or provided by such licensor, or (ii)
13+
* the Larger Works (as defined below), to deal in both
14+
*
15+
* (a) the Software, and
16+
*
17+
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
* one is included with the Software each a "Larger Work" to which the Software
19+
* is contributed by such licensors),
20+
*
21+
* without restriction, including without limitation the rights to copy, create
22+
* derivative works of, display, perform, and distribute the Software and make,
23+
* use, sell, offer for sale, import, export, have made, and have sold the
24+
* Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
* either these or other terms.
26+
*
27+
* This license is subject to the following condition:
28+
*
29+
* The above copyright notice and either this complete permission notice or at a
30+
* minimum a reference to the UPL must be included in all copies or substantial
31+
* portions of the Software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
* SOFTWARE.
40+
*/
141
package com.oracle.graal.python.builtins.modules.csv;
242

43+
import static com.oracle.graal.python.builtins.modules.csv.CSVModuleBuiltins.NOT_SET;
44+
45+
import java.util.List;
346

447
import com.oracle.graal.python.builtins.Builtin;
548
import com.oracle.graal.python.builtins.CoreFunctions;
@@ -12,10 +55,6 @@
1255
import com.oracle.truffle.api.dsl.NodeFactory;
1356
import com.oracle.truffle.api.dsl.Specialization;
1457

15-
import java.util.List;
16-
17-
import static com.oracle.graal.python.builtins.modules.csv.CSVModuleBuiltins.NOT_SET;
18-
1958
@CoreFunctions(extendClasses = PythonBuiltinClassType.CSVDialect)
2059
public class CSVDialectBuiltins extends PythonBuiltins {
2160

@@ -95,5 +134,4 @@ static boolean doIt(CSVDialect self) {
95134
return self.strict;
96135
}
97136
}
98-
99-
}
137+
}

0 commit comments

Comments
 (0)