GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Failed Conditions
Pull Request — master (#17)
by Yngve
04:14
created

PyreStrictTest.test_strict_all_python_files()   B

Complexity

Conditions 7

Size

Total Lines 26
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 26
rs 8
c 0
b 0
f 0
cc 7
nop 1
1
# pyre-strict
2
3
"""
4
We use Pyre Check to prevent type errors. However, for Pyre Check to fail if
5
type declarations aren't "perfect", all files need to start with a "pyre-strict"
6
comment. This test checks that all Python files start with such a comment.
7
"""
8
9
import unittest
10
import os
11
12
13
class PyreStrictTest(unittest.TestCase):
14
    """
15
    Check that all relevant Python files have Pyre set to strict mode.
16
    """
17
    def test_strict_all_python_files(self) -> None:
18
        """
19
        Check that all relevant Python files have Pyre set to strict mode.
20
        """
21
        for directory, _directories, files in os.walk('.'):
22
            for file in files:
23
                if not file.endswith('.py'):
24
                    continue
25
26
                path = os.path.join(directory, file)
27
28
                if './lib/' in path:
29
                    # Prevent false positive in Scrutinizer.
30
                    continue
31
32
                if './bin/activate_this.py' in path:
33
                    # Prevent false positive in Scrutinizer.
34
                    continue
35
36
                with open(path) as current_file:
37
                    first_line: str = current_file.readline()
38
39
                    self.assertEqual(
40
                        first_line,
41
                        '# pyre-strict\n',
42
                        path + ' is not set to Pyre strict mode.',
43
                    )
44