Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Fix 80 column violations #1598

Merged
merged 1 commit into from
Mar 10, 2016
Merged

[Python] Fix 80 column violations #1598

merged 1 commit into from
Mar 10, 2016

Conversation

practicalswift
Copy link
Contributor

What's in this pull request?

Fix 80 column violations in the project's Python code.

Resolved bug number: –


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

// {run_directive_1}
// {run_directive_2}
// {run_directive_3}
// {run_directive_4}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say that this part is an improvement...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Could we make an exception to apply this rule for lit RUN directives?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gribozavr I totally agree - it is really really ugly :-)

Short of doing an ugly work around I think the best solution would be to simply skip linting of this file using the # flake8: noqa directive.

@modocache Can you think of a way to make it more fine grained? # noqa can be applied on a line basis, but I guess that would mess up RUN: parsing.

@modocache
Copy link
Contributor

Looks fine to me, aside from @gribozavr's comments.

I imagine this will be one of the more controversial lint rules, but I'm glad we will have a rule in place at all.

@practicalswift
Copy link
Contributor Author

@gribozavr @modocache Thanks for reviewing and thanks for good input.

I've tried to address the issues identified by @gribozavr - please let me know if you find any additional things that needs fixing.

As for the ugly work around in validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py I removed that and excluded that file from linting (using # flake8: noqa). There simply does not seem to exist a way to keep that file under 80 columns without sacrificing readability :-)

@gribozavr
Copy link
Contributor

@practicalswift Thank you, I don't have further comments.

practicalswift added a commit that referenced this pull request Mar 10, 2016
…-in-python-code

[Python] Fix 80 column violations
@practicalswift practicalswift merged commit 42b7e3f into swiftlang:master Mar 10, 2016
@rintaro
Copy link
Member

rintaro commented Mar 10, 2016

@practicalswift
Python support \ escape even in """. So:

"""
// RUN: %S/../../../utils/gyb %s \
    -o %t/{testFilename} -D test_path="%S"
"""

should works.

OR, lit.py supports \ escape in RUN: like this, So:

"""
// RUN: %S/../../../utils/gyb %s \\
// RUN:     -o %t/{testFilename} -D test_path="%S"
"""

should also works.

@practicalswift
Copy link
Contributor Author

@rintaro Oh, I wasn't aware of that. Thanks a lot for noticing! 👍

I'll submit a PR fixing this right away :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants