diff --git a/build-support/flake8/.flake8 b/build-support/flake8/.flake8 index 669a3821471..9ad5c3ec6e2 100644 --- a/build-support/flake8/.flake8 +++ b/build-support/flake8/.flake8 @@ -5,8 +5,6 @@ extend-ignore: E501, # line too long (> 79 characters) E731, # Do not assign a lambda expression E741, # Ambiguous variable name (enable once fixed) - W291, # Trailing whitespace (enable once fixed) - W293, # Blank line contains whitespace (enable once fixed) W503, # line break before binary operator (conflicts with Black) W605, # invalid escape sequence (enable once fixed) PB10, # Bad class attribute (enable once fixed) diff --git a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_buildgen.py b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_buildgen.py index 3e0067fedcf..2313fc877a0 100644 --- a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_buildgen.py +++ b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_buildgen.py @@ -120,7 +120,7 @@ def test_noop_applicable_targets_complete_graph(self): contents=dedent( """ package jane - + var PublicConstant = 42 """ ), @@ -172,12 +172,12 @@ def stitch_deps_local(self, materialize): contents=dedent( """ package main - + import ( "fmt" "jane" ) - + func main() { fmt.Printf("Hello %s!", jane.PublicConstant) } @@ -235,9 +235,9 @@ def stitch_deps_remote(self, remote=True, materialize=False, fail_floating=False contents=dedent( """ package jane - + import "pantsbuild.org/fake/prod" - + var PublicConstant = prod.DoesNotExistButWeShouldNotCareWhenCheckingDepsAndNotInstalling """ ), @@ -247,12 +247,12 @@ def stitch_deps_remote(self, remote=True, materialize=False, fail_floating=False contents=dedent( """ package main - + import ( "fmt" "jane" ) - + func main() { fmt.Printf("Hello %s!", jane.PublicConstant) } @@ -342,7 +342,7 @@ def test_issues_2616(self): contents=dedent( """ package jane - + var PublicConstant = 42 """ ), @@ -352,17 +352,17 @@ def test_issues_2616(self): contents=dedent( """ package main - + /* #include */ import "C" // C was erroneously categorized as a remote lib in issue 2616. - + import ( "fmt" "jane" ) - + func main() { fmt.Printf("Hello %s!", jane.PublicConstant) fmt.Printf("Random from C: %d", int(C.random())) @@ -392,7 +392,7 @@ def test_issues_2787(self): contents=dedent( """ package helper - + const PublicConstant = 42 """ ), @@ -403,7 +403,7 @@ def test_issues_2787(self): contents=dedent( """ package lib - + const privateConstant = 42 """ ), @@ -414,12 +414,12 @@ def test_issues_2787(self): contents=dedent( """ package lib_test - + import ( "helper" "testing" ) - + func TestAdd(t *testing.T) { if privateConstant != helper.PublicConstant { t.Fatalf("got: %d, expected: %d", privateConstant, helper.PublicConstant) diff --git a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py index d3efe33cfd2..1587a987b5e 100644 --- a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py +++ b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py @@ -190,12 +190,12 @@ def test_issues_2616(self): "src/github.com/u/a/a.go", contents=""" package a - + import ( "fmt" "math" "sync" - + "bitbucket.org/u/b" ) """, @@ -204,15 +204,15 @@ def test_issues_2616(self): "src/github.com/u/a/b.go", contents=""" package a - + /* #include */ import "C" // C was erroneously categorized as a remote lib in issue 2616. - + import ( "fmt" - + "github.com/u/c" ) """, diff --git a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_test_integration.py b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_test_integration.py index d328904ffd1..9783d9d3c8c 100644 --- a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_test_integration.py +++ b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_test_integration.py @@ -54,12 +54,12 @@ def test_go_test_unstyle(self): dedent( """ package libUnstyle - + func Speak() { println("Hello from libUnstyle!") println("Bye from libUnstyle!") } - + func Add(a int, b int) int { return a + b } diff --git a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_thrift_gen_integration.py b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_thrift_gen_integration.py index d32b7b0d651..656102695d4 100644 --- a/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_thrift_gen_integration.py +++ b/contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_thrift_gen_integration.py @@ -55,9 +55,9 @@ def _create_thrift_project(self, thrift_files): dedent( """ package usethrift - + import "thrifttest/duck" - + func whatevs(f duck.Feeder) string { d := duck.NewDuck() f.Feed(d) diff --git a/contrib/mypy/src/python/pants/contrib/mypy/tasks/mypy_task.py b/contrib/mypy/src/python/pants/contrib/mypy/tasks/mypy_task.py index e8b8ff65e9f..dd68ce6779a 100644 --- a/contrib/mypy/src/python/pants/contrib/mypy/tasks/mypy_task.py +++ b/contrib/mypy/src/python/pants/contrib/mypy/tasks/mypy_task.py @@ -210,7 +210,7 @@ def _get_mypy_pex(self, py3_interpreter: PythonInterpreter, *extra_pexes: PEX) - os.path.realpath(p) for p in os.environ.get('PYTHONPATH', '').split(os.pathsep) ) - + site.getsitepackages = lambda: [ p for p in sys.path if os.path.realpath(p) not in PYTHONPATH ] diff --git a/contrib/python/tests/python/pants_test/contrib/python/checks/tasks/test_python_eval.py b/contrib/python/tests/python/pants_test/contrib/python/checks/tasks/test_python_eval.py index bcea5fd1473..c85478e44c7 100644 --- a/contrib/python/tests/python/pants_test/contrib/python/checks/tasks/test_python_eval.py +++ b/contrib/python/tests/python/pants_test/contrib/python/checks/tasks/test_python_eval.py @@ -29,8 +29,8 @@ def _create_graph(self, broken_c_library=True): "a.py": dedent( """ import inspect - - + + def compile_time_check_decorator(cls): if not inspect.isclass(cls): raise TypeError('This decorator can only be applied to classes, given {}'.format(cls)) @@ -47,8 +47,8 @@ def compile_time_check_decorator(cls): "b.py": dedent( """ from a.a import compile_time_check_decorator - - + + @compile_time_check_decorator class BarB(object): pass @@ -64,8 +64,8 @@ class BarB(object): "c.py": dedent( """ from a.a import compile_time_check_decorator - - + + @compile_time_check_decorator {}: pass @@ -84,8 +84,8 @@ class BarB(object): "d.py": dedent( """ from a.a import compile_time_check_decorator - - + + @compile_time_check_decorator class BazD(object): pass diff --git a/src/python/pants/backend/pants_info/list_backends_test.py b/src/python/pants/backend/pants_info/list_backends_test.py index f8796b266e5..2a223ac00e9 100644 --- a/src/python/pants/backend/pants_info/list_backends_test.py +++ b/src/python/pants/backend/pants_info/list_backends_test.py @@ -111,7 +111,7 @@ def test_list_backends() -> None: # V1 entry-point def register_goals(): pass - + # This naively looks like a V2 entry-point, but it's not! def rules(x: int): pass diff --git a/src/python/pants/backend/pants_info/list_target_types_test.py b/src/python/pants/backend/pants_info/list_target_types_test.py index 9a61da3c4fc..f404cc559e3 100644 --- a/src/python/pants/backend/pants_info/list_target_types_test.py +++ b/src/python/pants/backend/pants_info/list_target_types_test.py @@ -135,7 +135,7 @@ class CustomField(BoolField): ------------- Tests for Fortran code. - + This assumes that you use the FRUIT test framework. Valid fields: @@ -146,7 +146,7 @@ class CustomField(BoolField): fortran_version type: str | None, default: None - + timeout type: int | None, default: None The number of seconds to run before timing out. diff --git a/src/python/pants/backend/python/interpreter_cache.py b/src/python/pants/backend/python/interpreter_cache.py index ca5eb734c4d..456b400aac8 100644 --- a/src/python/pants/backend/python/interpreter_cache.py +++ b/src/python/pants/backend/python/interpreter_cache.py @@ -103,9 +103,9 @@ def select_interpreter_for_targets(self, targets): dedent( """\ Unable to detect a suitable interpreter for compatibilities: {} (Conflicting targets: {}) - + Pants detected these interpreter versions on your system: {} - + Possible ways to fix this: * Modify your Python interpreter constraints by following https://www.pantsbuild.org/python_readme.html#configure-the-python-version. * Ensure the targeted Python version is installed and discoverable. diff --git a/src/python/pants/backend/python/lint/pylint/rules_integration_test.py b/src/python/pants/backend/python/lint/pylint/rules_integration_test.py index a210b70529f..5934b3bdeca 100644 --- a/src/python/pants/backend/python/lint/pylint/rules_integration_test.py +++ b/src/python/pants/backend/python/lint/pylint/rules_integration_test.py @@ -192,7 +192,7 @@ def test_includes_direct_dependencies(self) -> None: name='transitive_req', requirements=[python_requirement('django')], ) - + python_requirement_library( name='direct_req', requirements=[python_requirement('ansicolors')], @@ -233,7 +233,7 @@ def test_includes_direct_dependencies(self) -> None: '''Pylint will check that variables exist and are used.''' from colors import green from direct_dep import THIS_VARIABLE_EXISTS - + print(green(THIS_VARIABLE_EXISTS)) """ ) @@ -288,7 +288,7 @@ def test_source_plugin(self) -> None: name='pylint', requirements=[python_requirement('pylint>=2.4.4,<2.5')], ) - + python_requirement_library( name='colors', requirements=[python_requirement('ansicolors')], diff --git a/src/python/pants/backend/python/tasks/pytest_run.py b/src/python/pants/backend/python/tasks/pytest_run.py index 3d89516218b..fa279e1a074 100644 --- a/src/python/pants/backend/python/tasks/pytest_run.py +++ b/src/python/pants/backend/python/tasks/pytest_run.py @@ -196,7 +196,7 @@ class InvalidShardSpecification(TaskError): [run] branch = True timid = False - + [report] exclude_lines = def __repr__ diff --git a/src/python/pants/bin/pants_loader.py b/src/python/pants/bin/pants_loader.py index e71aa255858..5918d4f4350 100644 --- a/src/python/pants/bin/pants_loader.py +++ b/src/python/pants/bin/pants_loader.py @@ -54,11 +54,11 @@ def ensure_locale(cls): """ Your system's preferred encoding is `{}`, but Pants requires `UTF-8`. Specifically, Python's `locale.getpreferredencoding()` must resolve to `UTF-8`. - + Fix it by setting the LC_* and LANG environment settings. Example: LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 - Or, bypass it by setting the below environment variable. + Or, bypass it by setting the below environment variable. {}=1 Note: we cannot guarantee consistent behavior with this bypass enabled. """.format( diff --git a/src/python/pants/core/goals/fmt_test.py b/src/python/pants/core/goals/fmt_test.py index 19df6c656f8..ae29f534d63 100644 --- a/src/python/pants/core/goals/fmt_test.py +++ b/src/python/pants/core/goals/fmt_test.py @@ -276,7 +276,7 @@ def assert_expected(*, per_target_caching: bool) -> None: f"""\ 𐄂 FortranFormatter made changes. {FortranTargets.stdout([fortran_address])} - + 𐄂 SmalltalkFormatter made changes. {SmalltalkTargets.stdout([smalltalk_address])} """ diff --git a/src/python/pants/engine/internals/engine_test.py b/src/python/pants/engine/internals/engine_test.py index 67600caed76..1640f8e4196 100644 --- a/src/python/pants/engine/internals/engine_test.py +++ b/src/python/pants/engine/internals/engine_test.py @@ -280,8 +280,8 @@ def a_from_c_and_d(c: C, d: D) -> A: File LOCATION-INFO, in fn_raises raise Exception('An exception for {{}}'.format(type(x).__name__)) Exception: An exception for B - - + + Computing Select(<{__name__}..B object at 0xEEEEEEEEE>, A) Computing Task(a_from_c_and_d(), <{__name__}..B object at 0xEEEEEEEEE>, A, true) Computing Task(c_from_b_nested_raise(), <{__name__}..B object at 0xEEEEEEEEE>, =C, true) diff --git a/src/python/pants/engine/internals/parsers_test.py b/src/python/pants/engine/internals/parsers_test.py index ea274ffdbfb..f355f7fcfb5 100644 --- a/src/python/pants/engine/internals/parsers_test.py +++ b/src/python/pants/engine/internals/parsers_test.py @@ -172,13 +172,13 @@ def test_multiple(self): document = dedent( """ # An example with several Bobs. - + # One with hobbies. { "type_alias": "pants.engine.internals.parsers_test.Bob", "hobbies": [1, 2, 3] } - + # Another that is aged. { "type_alias": "pants.engine.internals.parsers_test.Bob", @@ -193,17 +193,17 @@ def test_tricky_spacing(self): document = dedent( """ # An example with several Bobs. - + # One with hobbies. { "type_alias": "pants.engine.internals.parsers_test.Bob", - + # And internal comment and blank lines. - + "hobbies": [1, 2, 3]} { # This comment is inside an empty object that started on the prior line! } - + # Another that is aged. {"type_alias": "pants.engine.internals.parsers_test.Bob","age": 42} """ @@ -215,22 +215,22 @@ def test_error_presentation(self): document = dedent( """ # An example with several Bobs. - + # One with hobbies. { "type_alias": "pants.engine.internals.parsers_test.Bob", - + # And internal comment and blank lines. - + "hobbies": [1, 2, 3]} { # This comment is inside an empty object that started on the prior line! } - + # Another that is imaginary aged. { "type_alias": "pants.engine.internals.parsers_test.Bob", "age": 42i, - + "four": 1, "five": 1, "six": 1, @@ -260,22 +260,22 @@ def test_error_presentation(self): """ In document at {filepath}: # An example with several Bobs. - + # One with hobbies. {{ "type_alias": "pants.engine.internals.parsers_test.Bob", - + # And internal comment and blank lines. - + "hobbies": [1, 2, 3]}} {{ # This comment is inside an empty object that started on the prior line! }} - + # Another that is imaginary aged. 1: {{ 2: "type_alias": "pants.engine.internals.parsers_test.Bob", 3: "age": 42i, - + 4: "four": 1, 5: "five": 1, 6: "six": 1, @@ -354,7 +354,7 @@ def test_no_symbol_table(self): document = dedent( """ from pants.engine.internals.parsers_test import Bob - + nancy = Bob( hobbies=[1, 2, 3] ) diff --git a/src/python/pants/option/config_test.py b/src/python/pants/option/config_test.py index 233566f394c..5369461c79e 100644 --- a/src/python/pants/option/config_test.py +++ b/src/python/pants/option/config_test.py @@ -102,9 +102,9 @@ def content(self) -> str: that.''' [a] - # TODO: once TOML releases its new version with support for heterogenous lists, we should be - # able to rewrite this to `[1, 2, 3, "%(answer)s"`. See - # https://github.com/toml-lang/toml/issues/665. + # TODO: once TOML releases its new version with support for heterogenous lists, we should be + # able to rewrite this to `[1, 2, 3, "%(answer)s"`. See + # https://github.com/toml-lang/toml/issues/665. list = ["1", "2", "3", "%(answer)s"] list2.add = [7, 8, 9] list3.remove = ["x", "y", "z"] diff --git a/src/python/pants/option/options_bootstrapper_test.py b/src/python/pants/option/options_bootstrapper_test.py index 466ce5eca7a..9289fafe937 100644 --- a/src/python/pants/option/options_bootstrapper_test.py +++ b/src/python/pants/option/options_bootstrapper_test.py @@ -126,7 +126,7 @@ def test_create_bootstrapped_options(self) -> None: """ [foo] bar: %(pants_workdir)s/baz - + [fruit] apple: %(pants_supportdir)s/banana """ diff --git a/tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py b/tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py index d9adc9a9493..adc2384625e 100644 --- a/tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py +++ b/tests/python/pants_test/backend/codegen/grpcio/test_multiple_grpcio_gen.py @@ -16,7 +16,7 @@ def test_multiple_dependent_protobufs(self): """ syntax = "proto3"; package com.foo; - + service FooService { rpc Foo(FooRequest) returns (FooReply) {} } @@ -35,9 +35,9 @@ def test_multiple_dependent_protobufs(self): """ syntax = "proto3"; package com.bar; - + import "com/foo/foo_example.proto"; - + service BarService { rpc Bar(BarRequest) returns (BarReply) {} } diff --git a/tests/python/pants_test/backend/codegen/grpcio/test_single_grpcio_gen.py b/tests/python/pants_test/backend/codegen/grpcio/test_single_grpcio_gen.py index e6d17a9243e..479e9714511 100644 --- a/tests/python/pants_test/backend/codegen/grpcio/test_single_grpcio_gen.py +++ b/tests/python/pants_test/backend/codegen/grpcio/test_single_grpcio_gen.py @@ -16,7 +16,7 @@ def test_single_protobuf(self): """ syntax = "proto3"; package com.example; - + service FooService { rpc Foo(FooRequest) returns (FooReply) {} } diff --git a/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py b/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py index 380b3cb3b54..7b3895a7eba 100644 --- a/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py +++ b/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py @@ -370,13 +370,13 @@ def test_hermetic_binary_cache_with_dependencies(self): with self.with_overwritten_file_content(file_abs_path): new_temp_test = """package org.pantsbuild.example.hello.exe - + import java.io.{BufferedReader, InputStreamReader} import org.pantsbuild.example.hello import org.pantsbuild.example.hello.welcome - + // A simple jvm binary to illustrate Scala BUILD targets - + object Exe { /** Test that resources are properly namespaced. */ def getWorld: String = { @@ -390,7 +390,7 @@ def getWorld: String = { is.close() } } - + def main(args: Array[String]) { println("Num args passed: " + args.size + ". Stand by for welcome...") if (args.size <= 0) { diff --git a/tests/python/pants_test/backend/jvm/tasks/test_nailgun_task.py b/tests/python/pants_test/backend/jvm/tasks/test_nailgun_task.py index d5be827a4ac..58ac7f8f362 100644 --- a/tests/python/pants_test/backend/jvm/tasks/test_nailgun_task.py +++ b/tests/python/pants_test/backend/jvm/tasks/test_nailgun_task.py @@ -27,25 +27,25 @@ def execute(self): import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; - + import com.martiansoftware.nailgun.NGContext; - + public class Cwd { public static void nailMain(NGContext context) throws IOException { String comm_file = context.getArgs()[0]; String cwd = context.getWorkingDirectory(); communicate(comm_file, cwd, "nailMain"); } - + public static void main(String[] args) throws IOException { String comm_file = args[0]; String cwd = System.getProperty("user.dir"); - communicate(comm_file, cwd, "main"); + communicate(comm_file, cwd, "main"); } - + private static void communicate(String comm_file, String cwd, String source) throws IOException { - + Files.write(Paths.get(comm_file), Arrays.asList(source, cwd), Charset.forName("UTF-8")); } } diff --git a/tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py b/tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py index b6c293a83aa..2ef97688ab9 100644 --- a/tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py +++ b/tests/python/pants_test/backend/jvm/tasks/test_scalafmt.py @@ -68,7 +68,7 @@ def setUp(self): */ case class ScalaStyle(one: String,two: String,three: String,four: String, five: String,six: String,seven: String,eight: String, nine: String) - + class Person(name: String,age: Int,astrologicalSign: String, shoeSize: Int, favoriteColor: java.awt.Color) { diff --git a/tests/python/pants_test/backend/python/tasks/test_isort_run.py b/tests/python/pants_test/backend/python/tasks/test_isort_run.py index 1cb6d18b57d..e710c4c4ac4 100644 --- a/tests/python/pants_test/backend/python/tasks/test_isort_run.py +++ b/tests/python/pants_test/backend/python/tasks/test_isort_run.py @@ -48,9 +48,9 @@ class PythonIsortTest(PythonTaskTestBase): RESULT_B = dedent( """ - from __future__ import (absolute_import, - division, - print_function, + from __future__ import (absolute_import, + division, + print_function, unicode_literals) """ ) diff --git a/tests/python/pants_test/backend/python/tasks/test_pytest_run.py b/tests/python/pants_test/backend/python/tasks/test_pytest_run.py index acbbca0621d..44c61c7f838 100644 --- a/tests/python/pants_test/backend/python/tasks/test_pytest_run.py +++ b/tests/python/pants_test/backend/python/tasks/test_pytest_run.py @@ -283,7 +283,7 @@ def use_two(): # line 4 import unittest import app - + class AppTest(unittest.TestCase): def test_use_two(self): self.assertEqual(2, app.use_two()) @@ -367,9 +367,9 @@ def test_use_two(self): dedent( """ import unittest - + import core - + class CoreGreenTest(unittest.TestCase): def test_one(self): self.assertEqual(1, core.one()) @@ -382,9 +382,9 @@ def test_one(self): dedent( """ import unittest - + import core - + class CoreGreen2Test(unittest.TestCase): def test_one(self): self.assertEqual(1, core.one()) @@ -397,9 +397,9 @@ def test_one(self): dedent( """ import unittest - + import core - + class CoreGreen3Test(unittest.TestCase): def test_one(self): self.assertEqual(1, core.one()) @@ -412,7 +412,7 @@ def test_one(self): dedent( """ import core - + def test_two(): assert 1 == core.two() """ @@ -424,9 +424,9 @@ def test_two(): dedent( """ import unittest - + import core - + class CoreRedClassTest(unittest.TestCase): def test_one_in_class(self): self.assertEqual(1, core.two()) @@ -440,7 +440,7 @@ def test_one_in_class(self): """ import core import time - + def test_three(): time.sleep(10) assert 1 == core.one() @@ -464,7 +464,7 @@ def test_error(bad_fixture): """ def null(): pass - + assert(False) """ ), @@ -709,9 +709,9 @@ def one(): # line 1 dedent( """ import unittest - + from util import math - + class MathTest(unittest.TestCase): def test_one(self): self.assertEqual(1, math.one()) @@ -762,9 +762,9 @@ def one(): # line 2 dedent( """ import unittest # line 1 - + from util import math # line 3 - + class MathTestInSameDirectoryAsSource(unittest.TestCase): # line 5 def test_one(self): # line 6 self.assertEqual(1, math.one()) # line 7 @@ -840,9 +840,9 @@ def one(): # line 1 dedent( """ import unittest - + from util import math - + class MathTest(unittest.TestCase): def test_one(self): self.assertEqual(1, math.one()) diff --git a/tests/python/pants_test/backend/python/tasks/test_python_repl.py b/tests/python/pants_test/backend/python/tasks/test_python_repl.py index 37e3668010b..be55e3eddaa 100644 --- a/tests/python/pants_test/backend/python/tasks/test_python_repl.py +++ b/tests/python/pants_test/backend/python/tasks/test_python_repl.py @@ -63,8 +63,8 @@ def setUp(self): "lib.py": dedent( """ import six - - + + def go(): six.print_('go', 'go', 'go!', sep='') """ diff --git a/tests/python/pants_test/backend/python/tasks/test_setup_py.py b/tests/python/pants_test/backend/python/tasks/test_setup_py.py index 2c174231ddb..35ba6d63f2c 100644 --- a/tests/python/pants_test/backend/python/tasks/test_setup_py.py +++ b/tests/python/pants_test/backend/python/tasks/test_setup_py.py @@ -407,7 +407,7 @@ def test_resources(self): version='0.0.0', ) ) - + resources( name='j-function', sources=['j-function.res'] @@ -466,7 +466,7 @@ def test_symlinks_issues_2815(self): version='0.0.0', ) ) - + resources( name='group_res', sources=['group.res'] diff --git a/tests/python/pants_test/base/test_exception_sink_integration.py b/tests/python/pants_test/base/test_exception_sink_integration.py index 9c569cb0a23..69fd54cf7c6 100644 --- a/tests/python/pants_test/base/test_exception_sink_integration.py +++ b/tests/python/pants_test/base/test_exception_sink_integration.py @@ -58,8 +58,8 @@ def test_fails_ctrl_c_cffi_extern(self): dedent( """\ KeyboardInterrupt: ctrl-c interrupted execution of a cffi method! - - + + The engine execution request raised this error, which is probably due to the errors in the CFFI extern methods listed above, as CFFI externs return None upon error: Traceback (most recent call last): diff --git a/tests/python/pants_test/core_tasks/test_deferred_sources_mapper_integration.py b/tests/python/pants_test/core_tasks/test_deferred_sources_mapper_integration.py index 9f8c6cdcd82..67e6e181df4 100644 --- a/tests/python/pants_test/core_tasks/test_deferred_sources_mapper_integration.py +++ b/tests/python/pants_test/core_tasks/test_deferred_sources_mapper_integration.py @@ -24,7 +24,7 @@ def _emit_targets(cls, buildroot): platform='java8', ), ) - + remote_sources(name='proto-9', dest=java_protobuf_library, sources_target=':external-source', @@ -35,7 +35,7 @@ def _emit_targets(cls, buildroot): ':proto-sources', ], ) - + # A target with a separate sources_target remote_sources(name='proto-other', dest=java_protobuf_library, @@ -47,31 +47,31 @@ def _emit_targets(cls, buildroot): ':proto-sources', ], ) - + remote_sources(name='proto-sources', dest=resources, sources_target=':external-source', ) - + unpacked_jars(name='external-source', libraries=[':external-source-jars'], include_patterns=[ 'com/squareup/testing/**/*.proto', ], ) - + remote_sources(name='other-proto-sources', dest=resources, sources_target=':other-external-source', ) - + unpacked_jars(name='other-external-source', libraries=[':external-source-jars'], include_patterns=[ 'com/squareup/testing/*.proto', ], ) - + jar_library(name='external-source-jars', jars=[ jar(org='com.squareup.testing.protolib', name='protolib-external-test', rev='0.0.2'), diff --git a/tests/python/pants_test/integration/graph_integration_test.py b/tests/python/pants_test/integration/graph_integration_test.py index d10442ac081..fe7887a53fc 100644 --- a/tests/python/pants_test/integration/graph_integration_test.py +++ b/tests/python/pants_test/integration/graph_integration_test.py @@ -77,12 +77,12 @@ def setup_sources_targets(self) -> Iterator[None]: name='missing-rglobs', sources=['**/*.a'], ) - + resources( name='some-missing-some-not', sources=['*.txt', '*.rs'], ) - + resources( name='overlapping-globs', sources=['sources.txt', '*.txt'], diff --git a/tests/python/pants_test/pantsd/test_pantsd_integration.py b/tests/python/pants_test/pantsd/test_pantsd_integration.py index 4f165e94ca5..ef2cadcf2aa 100644 --- a/tests/python/pants_test/pantsd/test_pantsd_integration.py +++ b/tests/python/pants_test/pantsd/test_pantsd_integration.py @@ -660,7 +660,7 @@ def test_dependencies_swap(self): source = 'A.py', {a_deps} ) - + python_library( name = 'B', source = 'B.py', diff --git a/tests/python/pants_test/repo_scripts/test_git_hooks.py b/tests/python/pants_test/repo_scripts/test_git_hooks.py index c0f21bbc2fa..b3f7872410b 100644 --- a/tests/python/pants_test/repo_scripts/test_git_hooks.py +++ b/tests/python/pants_test/repo_scripts/test_git_hooks.py @@ -136,7 +136,7 @@ def assert_header_check(added_files, expected_excerpt): f"""\ # Copyright {cur_year} Pants project contributors (see CONTRIBUTORS.md). # Licensed under the MIT License, Version 3.3 (see LICENSE). - + """ ), ) @@ -152,7 +152,7 @@ def assert_header_check(added_files, expected_excerpt): """\ # Copyright YYYY Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). - + """ ), ) @@ -172,7 +172,7 @@ def assert_header_check(added_files, expected_excerpt): f"""\ # Copyright {last_year} Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). - + """ ), ) diff --git a/tests/python/pants_test/targets/test_scala_library.py b/tests/python/pants_test/targets/test_scala_library.py index 0ed173d0480..bcbc5c983c1 100644 --- a/tests/python/pants_test/targets/test_scala_library.py +++ b/tests/python/pants_test/targets/test_scala_library.py @@ -70,7 +70,7 @@ def setUp(self): '3rdparty:hub-and-spoke', ] ) - + java_library( name='no_scala_dep', sources=[], diff --git a/tests/python/pants_test/task/test_simple_codegen_task.py b/tests/python/pants_test/task/test_simple_codegen_task.py index 52d68ca6b2a..db229a5b612 100644 --- a/tests/python/pants_test/task/test_simple_codegen_task.py +++ b/tests/python/pants_test/task/test_simple_codegen_task.py @@ -226,7 +226,7 @@ def _get_duplication_test_targets(self): sources=['org/pantsbuild/example/good-child.dummy'], dependencies=['gen-parent'], ) - + dummy_library(name='bad', sources=['org/pantsbuild/example/bad-child.dummy'], dependencies=['gen-parent'], @@ -524,7 +524,7 @@ def test_merges_exports(self): dedent( """ dummy_library(name='flaam', sources=[]) - + exporting_dummy_library(name='fleem', sources=['org/pantsbuild/example/fleem.dummy'], dependencies=[':flaam'], @@ -558,7 +558,7 @@ def test_exports_always_copied_even_if_no_extra(self): dedent( """ dummy_library(name='flaam', sources=[]) - + exporting_dummy_library(name='fleem', sources=['org/pantsbuild/example/fleem.dummy'], dependencies=[':flaam'], @@ -627,7 +627,7 @@ def test_additional_extra_dependency_fine(self): dedent( """ dummy_library(name='flaam', sources=[]) - + exporting_dummy_library(name='fleem', sources=['org/pantsbuild/example/fleem.dummy'], ) diff --git a/tests/python/pants_test/tasks/test_changed_target_integration.py b/tests/python/pants_test/tasks/test_changed_target_integration.py index 58821bac878..39981b63bd7 100644 --- a/tests/python/pants_test/tasks/test_changed_target_integration.py +++ b/tests/python/pants_test/tasks/test_changed_target_integration.py @@ -26,7 +26,7 @@ def known_commits(self): dedent( """ package org.pantsbuild; - + class Class { static final int MEANING_OF_LIFE = 42; } @@ -47,10 +47,10 @@ class Class { dedent( """ package org.pantsbuild; - + import org.junit.Assert; import org.junit.Test; - + public class ClassTest { @Test public void test() { Assert.assertEquals(42, Class.MEANING_OF_LIFE); @@ -66,7 +66,7 @@ class Class { dedent( f""" jar_library(name='junit', jars=[jar('junit', 'junit', '4.12')]) - + junit_tests( name='pantsbuild', sources=['ClassTest.java'],