- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
ID: python-code-style/function-naming
Language: Python
Severity: Notice
Category: Code Style
Ensure that function use snake_case
.
This rule is not valid for tests files (prefixed by test_
or suffixed by _test.py
) because testing requires some camel case methods, such as, tearDown
, setUp
, and more.
def _plop_plip(G, most_valuable_edge):
pass
class MyClass:
def visit_Call_Call(something):
pass
def my_function(myParameter, otherParameter):
pass
def myFunction(arg1, arg2):
pass
def myOtherFunction():
pass
def test_get_major_OS_device(self, *mocks):
pass
# name used in many testing frameworks. Do not warn on it
def tearDown(self):
"""After each test case, reset and remove the dummy tracer"""
super(TracerTestCase, self).tearDown()
class TestModel(unittest.TestCase):
def setUp(self): # used in a file model_test.py, skip the rule for setUp and tearDown
pass
def tearDown(self): # used in a file model_test.py, skip the rule for setUp and tearDown
pass
def test_violation_category(self):
self.assertEqual(ViolationCategory.BEST_PRACTICE.value, 1)
self.assertEqual(ViolationCategory.DESIGN.value, 2)
v1 = Violation("bla", 1, "description", 2, ViolationCategory.BEST_PRACTICE, 10, "notool")
self.assertEqual(v1.get_category_string(), "Best Practices")
v1 = Violation("bla", 1, "description", 2, 1, 10, "notool")
self.assertEqual(v1.get_category_string(), "Unknown")
|
|
For more information, please read the Code Analysis documentation
Identify code vulnerabilities directly in yourVS Code editor
Identify code vulnerabilities directly inJetBrains products