Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9f84ad7
add placeholders
MJoshuaB Aug 11, 2024
c81ff56
add new placeholder comments
MJoshuaB Aug 20, 2024
18762be
exploring AST unfinished - minor emergency had to leave
Aug 21, 2024
2238161
identifying some mismatched functions
Aug 28, 2024
95fe015
refactor checker and tests
MJoshuaB Aug 28, 2024
e2e664f
fix error with non-builtins decorators
MJoshuaB Aug 28, 2024
46053e6
fine tuning and testing required
Aug 29, 2024
b402a5d
add pylint report
MJoshuaB Aug 29, 2024
3d051d7
add ranked listing of reports
MJoshuaB Aug 29, 2024
fdf6db7
format report as table
MJoshuaB Aug 29, 2024
fb160d5
add new verbs
MJoshuaB Sep 1, 2024
f06c915
update report
MJoshuaB Sep 2, 2024
db697b2
update reportcounts.md
MJoshuaB Sep 2, 2024
ae66d2c
fix formatting for reportcounts.md
MJoshuaB Sep 2, 2024
233f536
update reportcounts.md
MJoshuaB Sep 2, 2024
27edb80
minimal tests added
Sep 3, 2024
112173d
Merge pull request #2 from Azure/main
JessicaBell00 Sep 8, 2024
c5ffb91
Merge branch 'Azure:main' into main
JessicaBell00 Sep 10, 2024
7dc03ca
Merge branch 'working-main' into main
JessicaBell00 Sep 12, 2024
18f09e9
Merge pull request #5 from MJoshuaB/main
JessicaBell00 Sep 12, 2024
af098f7
Merge branch 'Azure:main' into working-main
JessicaBell00 Sep 12, 2024
6e53b16
Final Refactor
Sep 17, 2024
80657b4
not running multiple times picking up on different function types
Sep 19, 2024
5b69e7e
Merge branch 'main' into invalid-use-of-@overload
16234397 Sep 19, 2024
b10a3cd
add TODOs
MJoshuaB Sep 21, 2024
a0e5c18
removed code not reached
Sep 24, 2024
bf6936c
Merge remote-tracking branch 'origin/invalid-use-of-@overload' into i…
Sep 24, 2024
3ed8120
Checks at a class level
Sep 24, 2024
ac9921a
Merge branch 'main' into invalid-use-of-@overload
16234397 Sep 24, 2024
4c638df
Looking into different connection_verify assignments
Sep 25, 2024
ab62179
Placeholders added back
16234397 Sep 26, 2024
795c861
Checker base done
Sep 26, 2024
35094ba
exclue private namespaces and classes
MJoshuaB Sep 26, 2024
ed5e211
update reports
MJoshuaB Sep 27, 2024
a835da4
Checker, Tests, & Readme done
Sep 29, 2024
ae88cee
add new prefixes
MJoshuaB Oct 1, 2024
efe6ddc
Merge branch 'main' into working-main
MJoshuaB Oct 1, 2024
0bf7340
Merge branch 'working-main' into approved_prefix
MJoshuaB Oct 2, 2024
cfaa891
update unit tests
MJoshuaB Oct 2, 2024
a6f341a
remove reports
MJoshuaB Oct 2, 2024
5947f31
remove commented code
MJoshuaB Oct 2, 2024
65e431f
add checker to README
MJoshuaB Oct 2, 2024
c50a082
Merge branch 'working-main' into do-not-hardcode-boolean-connection_v…
16234397 Oct 5, 2024
24e9647
Merge pull request #10 from MJoshuaB/do-not-hardcode-boolean-connecti…
16234397 Oct 5, 2024
1f78550
Merge branch 'working-main' into invalid-use-of-@overload
16234397 Oct 5, 2024
56176ca
Merge pull request #11 from MJoshuaB/invalid-use-of-@overload
16234397 Oct 5, 2024
8cdce20
Tidy Up
Oct 5, 2024
6d262e3
Merge branch 'working-main' into approved_prefix
MJoshuaB Oct 6, 2024
9217630
Revert "Merge branch 'working-main' into approved_prefix"
MJoshuaB Oct 7, 2024
d64d347
remove duplicate tests
MJoshuaB Oct 8, 2024
bb867c7
Merge branch 'main' into approved_prefix
MJoshuaB Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Final Refactor
  • Loading branch information
Alirose Burrell committed Sep 17, 2024
commit 6e53b162fecd06f65d07804903dba11b17b7ce15
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,8 @@ def visit_call(self, node):

# Obtain a list of all functions and function names
functions = []
if klass is not None:
try:
klass.body
for item in klass.body:
if hasattr(item, 'name'):
functions.append(item)
Expand Down Expand Up @@ -2801,6 +2802,9 @@ def visit_call(self, node):
node=node,
confidence=None,
)
except:
pass


def is_function_async(self, node):
"""Check if a function is async"""
Expand All @@ -2816,8 +2820,6 @@ def is_function_async(self, node):
return False




# [Pylint] Custom Linter check for Exception Logging #3227
# [Pylint] Address Commented out Pylint Custom Plugin Checkers #3228
# [Pylint] Add a check for connection_verify hardcoded settings #35355
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Test file for InvalidUseOfOverload checker
# Test file for InvalidUseOfOverload checker - testing what mypy doesn't pick up

from typing import Awaitable, overload, Union

Expand All @@ -14,4 +14,4 @@ def double(a: int):
async def double(a: Union[str, int]) -> int:
if isinstance(a, str):
return len(a)*2
return a * 2
return a * 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Test file for InvalidUseOfOverload checker - testing what mypy doesn't pick up

from typing import Awaitable, overload, Union

@overload
def double(a: str):
...

@overload
def double(a: int):
...

async def double(a: Union[str, int]) -> int:
if isinstance(a, str):
return len(a)*2
return a * 2
Original file line number Diff line number Diff line change
Expand Up @@ -4851,26 +4851,25 @@ def test_valid_use_overload(self):


def test_invalid_use_overload(self):
file = open(
os.path.join(
TEST_FOLDER, "test_files", "invalid_use_of_overload_violation.py"
)
)
node = astroid.parse(file.read())
file.close()
with self.assertAddsMessages(
pylint.testutils.MessageTest(
msg_id="invalid-use-of-overload",
line=0,
node=node,
col_offset=0,
)
):
self.checker.visit_call(node)



violation_viles = ["_1", "_2"]
for violation in violation_viles:

file = open(
os.path.join(
TEST_FOLDER, "test_files", "invalid_use_of_overload_violation"+violation+".py"
)
)
node = astroid.parse(file.read())
file.close()
with self.assertAddsMessages(
pylint.testutils.MessageTest(
msg_id="invalid-use-of-overload",
line=0,
node=node,
col_offset=0,
),
):
self.checker.visit_call(node)


# [Pylint] Custom Linter check for Exception Logging #3227
Expand Down