Skip to content

Commit 76fd449

Browse files
committed
Fix lint errors
1 parent 7043399 commit 76fd449

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

met-api/setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ ignore = I001, I003, I004, I100, I101, I201, I202, E126, W504
3838
exclude = .git,*migrations*
3939
max-line-length = 120
4040
docstring-min-length=10
41+
# Disable print statement warning in config file - logger is not initialized yet
4142
per-file-ignores =
4243
*/__init__.py:F401
43-
*/config.py:N802,T201 # Disable print statement warning in config file - logger is not initialized yet
44+
*/config.py:N802,T201
4445

4546
[pycodestyle]
4647
max-line-length = 120

met-api/src/met_api/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def __init__(self) -> None:
8585
Performs more advanced configuration logic that is not possible
8686
in the normal class definition.
8787
"""
88-
8988
# apply configs to _Config in the format that flask_jwt_oidc expects
9089
# this flattens the JWT_CONFIG dict into individual attributes
9190
for key, value in self.JWT_CONFIG.items():

met-api/tests/unit/utils/test_logging_masker.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616

1717
import logging
1818

19-
from met_api.utils.logging_masker import (
20-
SensitiveDataFilter,
21-
mask_dict,
22-
mask_url,
23-
)
19+
from met_api.utils.logging_masker import SensitiveDataFilter, mask_dict, mask_url
2420

2521

2622
def test_logging_masker():
@@ -32,8 +28,7 @@ def test_logging_masker():
3228
assert 'user' not in masked_url
3329
# Count occurrences of redaction to ensure we are masking both username and password
3430
assert masked_url.count('***REDACTED***') == 2
35-
36-
31+
3732
# Test dictionary masking with various sensitive keys
3833
data = {
3934
'username': 'admin',
@@ -52,10 +47,10 @@ def test_logging_masker():
5247
assert masked_data['config']['secret'] == '***REDACTED***'
5348
assert masked_data['username'] == 'admin'
5449
assert masked_data['email'] == 'test@example.com'
55-
50+
5651
# Test SensitiveDataFilter with various patterns
5752
filter_obj = SensitiveDataFilter()
58-
53+
5954
# Test SQLAlchemy URL
6055
log_record = logging.LogRecord(
6156
name='test', level=logging.INFO, pathname='', lineno=0,
@@ -65,7 +60,7 @@ def test_logging_masker():
6560
filter_obj.filter(log_record)
6661
assert 'complexP@ss123' not in str(log_record.msg)
6762
assert '***REDACTED***' in str(log_record.msg)
68-
63+
6964
# Test JWT token
7065
jwt_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0In0.abc123'
7166
log_record = logging.LogRecord(
@@ -76,7 +71,7 @@ def test_logging_masker():
7671
filter_obj.filter(log_record)
7772
assert jwt_token not in str(log_record.msg)
7873
assert '***REDACTED_JWT***' in str(log_record.msg)
79-
74+
8075
# Test normal content preservation
8176
normal_message = 'Processing user request for engagement ID 123'
8277
log_record = logging.LogRecord(

0 commit comments

Comments
 (0)