Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fe715a

Browse files
committed
Python: Fix query names that inclde __ (dunder)
Without backticks, the text UNDERSCORE UNDERSCORE eq UNDERSCORE UNDERSCORE would be considered to make things bold in our markdown output, making the query info look strange. Example https://codeql.github.com/codeql-query-help/python/py-slots-in-old-style-class/
1 parent 5db1984 commit 3fe715a

24 files changed

Lines changed: 36 additions & 36 deletions

python/ql/src/Classes/DefineEqualsWhenAddingAttributes.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name __eq__ not overridden when adding attributes
2+
* @name `__eq__` not overridden when adding attributes
33
* @description When adding new attributes to instances of a class, equality for that class needs to be defined.
44
* @kind problem
55
* @tags reliability

python/ql/src/Classes/InitCallsSubclassMethod.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name __init__ method calls overridden method
3-
* @description Calling a method from __init__ that is overridden by a subclass may result in a partially
2+
* @name `__init__` method calls overridden method
3+
* @description Calling a method from `__init__` that is overridden by a subclass may result in a partially
44
* initialized instance being observed.
55
* @kind problem
66
* @tags reliability

python/ql/src/Classes/MaybeUndefinedClassAttribute.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Maybe undefined class attribute
3-
* @description Accessing an attribute of 'self' that is not initialized in the __init__ method may cause an AttributeError at runtime
3+
* @description Accessing an attribute of `self` that is not initialized in the `__init__` method may cause an AttributeError at runtime
44
* @kind problem
55
* @tags reliability
66
* correctness

python/ql/src/Classes/MissingCallToDel.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Missing call to __del__ during object destruction
3-
* @description An omitted call to a super-class __del__ method may lead to class instances not being cleaned up properly.
2+
* @name Missing call to `__del__` during object destruction
3+
* @description An omitted call to a super-class `__del__` method may lead to class instances not being cleaned up properly.
44
* @kind problem
55
* @tags efficiency
66
* correctness

python/ql/src/Classes/MissingCallToInit.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Missing call to __init__ during object initialization
3-
* @description An omitted call to a super-class __init__ method may lead to objects of this class not being fully initialized.
2+
* @name Missing call to `__init__` during object initialization
3+
* @description An omitted call to a super-class `__init__` method may lead to objects of this class not being fully initialized.
44
* @kind problem
55
* @tags reliability
66
* correctness

python/ql/src/Classes/MutatingDescriptor.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name Mutation of descriptor in __get__ or __set__ method.
2+
* @name Mutation of descriptor in `__get__` or `__set__` method.
33
* @description Descriptor objects can be shared across many instances. Mutating them can cause strange side effects or race conditions.
44
* @kind problem
55
* @tags reliability

python/ql/src/Classes/OverwritingAttributeInSuperClass.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Overwriting attribute in super-class or sub-class
3-
* @description Assignment to self attribute overwrites attribute previously defined in subclass or superclass __init__ method.
3+
* @description Assignment to self attribute overwrites attribute previously defined in subclass or superclass `__init__` method.
44
* @kind problem
55
* @tags reliability
66
* maintainability

python/ql/src/Classes/SlotsInOldStyleClass.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name '__slots__' in old-style class
3-
* @description Overriding the class dictionary by declaring '__slots__' is not supported by old-style
2+
* @name `__slots__` in old-style class
3+
* @description Overriding the class dictionary by declaring `__slots__` is not supported by old-style
44
* classes.
55
* @kind problem
66
* @problem.severity error

python/ql/src/Classes/SuperclassDelCalledMultipleTimes.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Multiple calls to __del__ during object destruction
3-
* @description A duplicated call to a super-class __del__ method may lead to class instances not be cleaned up properly.
2+
* @name Multiple calls to `__del__` during object destruction
3+
* @description A duplicated call to a super-class `__del__` method may lead to class instances not be cleaned up properly.
44
* @kind problem
55
* @tags efficiency
66
* correctness

python/ql/src/Classes/SuperclassInitCalledMultipleTimes.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Multiple calls to __init__ during object initialization
3-
* @description A duplicated call to a super-class __init__ method may lead to objects of this class not being properly initialized.
2+
* @name Multiple calls to `__init__` during object initialization
3+
* @description A duplicated call to a super-class `__init__` method may lead to objects of this class not being properly initialized.
44
* @kind problem
55
* @tags reliability
66
* correctness

0 commit comments

Comments
 (0)