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/
This commit is contained in:
Rasmus Wriedt Larsen
2021-02-04 15:49:37 +01:00
parent 5db1984315
commit 3fe715abb6
24 changed files with 36 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
/**
* @name __eq__ not overridden when adding attributes
* @name `__eq__` not overridden when adding attributes
* @description When adding new attributes to instances of a class, equality for that class needs to be defined.
* @kind problem
* @tags reliability

View File

@@ -1,6 +1,6 @@
/**
* @name __init__ method calls overridden method
* @description Calling a method from __init__ that is overridden by a subclass may result in a partially
* @name `__init__` method calls overridden method
* @description Calling a method from `__init__` that is overridden by a subclass may result in a partially
* initialized instance being observed.
* @kind problem
* @tags reliability

View File

@@ -1,6 +1,6 @@
/**
* @name Maybe undefined class attribute
* @description Accessing an attribute of 'self' that is not initialized in the __init__ method may cause an AttributeError at runtime
* @description Accessing an attribute of `self` that is not initialized in the `__init__` method may cause an AttributeError at runtime
* @kind problem
* @tags reliability
* correctness

View File

@@ -1,6 +1,6 @@
/**
* @name Missing call to __del__ during object destruction
* @description An omitted call to a super-class __del__ method may lead to class instances not being cleaned up properly.
* @name Missing call to `__del__` during object destruction
* @description An omitted call to a super-class `__del__` method may lead to class instances not being cleaned up properly.
* @kind problem
* @tags efficiency
* correctness

View File

@@ -1,6 +1,6 @@
/**
* @name Missing call to __init__ during object initialization
* @description An omitted call to a super-class __init__ method may lead to objects of this class not being fully initialized.
* @name Missing call to `__init__` during object initialization
* @description An omitted call to a super-class `__init__` method may lead to objects of this class not being fully initialized.
* @kind problem
* @tags reliability
* correctness

View File

@@ -1,5 +1,5 @@
/**
* @name Mutation of descriptor in __get__ or __set__ method.
* @name Mutation of descriptor in `__get__` or `__set__` method.
* @description Descriptor objects can be shared across many instances. Mutating them can cause strange side effects or race conditions.
* @kind problem
* @tags reliability

View File

@@ -1,6 +1,6 @@
/**
* @name Overwriting attribute in super-class or sub-class
* @description Assignment to self attribute overwrites attribute previously defined in subclass or superclass __init__ method.
* @description Assignment to self attribute overwrites attribute previously defined in subclass or superclass `__init__` method.
* @kind problem
* @tags reliability
* maintainability

View File

@@ -1,6 +1,6 @@
/**
* @name '__slots__' in old-style class
* @description Overriding the class dictionary by declaring '__slots__' is not supported by old-style
* @name `__slots__` in old-style class
* @description Overriding the class dictionary by declaring `__slots__` is not supported by old-style
* classes.
* @kind problem
* @problem.severity error

View File

@@ -1,6 +1,6 @@
/**
* @name Multiple calls to __del__ during object destruction
* @description A duplicated call to a super-class __del__ method may lead to class instances not be cleaned up properly.
* @name Multiple calls to `__del__` during object destruction
* @description A duplicated call to a super-class `__del__` method may lead to class instances not be cleaned up properly.
* @kind problem
* @tags efficiency
* correctness

View File

@@ -1,6 +1,6 @@
/**
* @name Multiple calls to __init__ during object initialization
* @description A duplicated call to a super-class __init__ method may lead to objects of this class not being properly initialized.
* @name Multiple calls to `__init__` during object initialization
* @description A duplicated call to a super-class `__init__` method may lead to objects of this class not being properly initialized.
* @kind problem
* @tags reliability
* correctness

View File

@@ -1,6 +1,6 @@
/**
* @name Undefined class attribute
* @description Accessing an attribute of 'self' that is not initialized anywhere in the class in the __init__ method may cause an AttributeError at runtime
* @description Accessing an attribute of `self` that is not initialized anywhere in the class in the `__init__` method may cause an AttributeError at runtime
* @kind problem
* @tags reliability
* correctness

View File

@@ -1,6 +1,6 @@
/**
* @name Useless class
* @description Class only defines one public method (apart from __init__ or __new__) and should be replaced by a function
* @description Class only defines one public method (apart from `__init__` or `__new__`) and should be replaced by a function
* @kind problem
* @tags maintainability
* useless-code

View File

@@ -1,6 +1,6 @@
/**
* @name Wrong number of arguments in a class instantiation
* @description Using too many or too few arguments in a call to the __init__
* @description Using too many or too few arguments in a call to the `__init__`
* method of a class will result in a TypeError at runtime.
* @kind problem
* @tags reliability