forked from lyft/xiblint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lyft#41 from lyft/fix_mypy
Fix mypy type annotations
- Loading branch information
Showing
17 changed files
with
74 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ htmlcov/ | |
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
/.mypy_cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from xiblint.rules import Rule | ||
|
||
if False: # if TYPE_CHECKING: | ||
from xiblint.xibcontext import XibContext | ||
|
||
|
||
class NoSimulatedMetrics(Rule): | ||
""" | ||
Ensures there are no `simulatedMetricsContainer`s, which were removed with Xcode 9 | ||
""" | ||
def check(self, context): # type: (Rule, xiblint.xibcontext.XibContext) -> None | ||
def check(self, context): # type: (XibContext) -> None | ||
root = context.tree.getroot() | ||
for container in root.findall('.//simulatedMetricsContainer'): | ||
context.error(container, 'SimulatedMetricsContainers should be removed (resave with Xcode 9+)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from xiblint.rules import Rule | ||
|
||
if False: # if TYPE_CHECKING: | ||
from xiblint.xibcontext import XibContext | ||
|
||
|
||
class NoTraitVariations(Rule): | ||
""" | ||
Checks for Trait Variations being enabled. | ||
""" | ||
def check(self, context): # type: (Rule, xiblint.xibcontext.XibContext) -> None | ||
def check(self, context): # type: (XibContext) -> None | ||
root = context.tree.getroot() | ||
if root.get('useTraitCollections') == 'YES' and root.get('targetRuntime') != 'watchKit': | ||
context.error(root, "Document has 'Use Trait Variations' enabled") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from xiblint.rules import Rule | ||
|
||
if False: # if TYPE_CHECKING: | ||
from xiblint.xibcontext import XibContext | ||
|
||
|
||
class NoViewControllerLinksToOtherBundles(Rule): | ||
""" | ||
Ensures there are no links to storyboards in different bundles | ||
""" | ||
def check(self, context): # type: (Rule, xiblint.xibcontext.XibContext) -> None | ||
def check(self, context): # type: (XibContext) -> None | ||
for element in context.tree.findall(".//viewControllerPlaceholder"): | ||
if element.get("bundleIdentifier"): | ||
context.error(element, "Linking to a view controller in another bundle") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters