chore: Sync MokoStandards workflows and configurations #71
@@ -27,13 +27,12 @@ NOTE: Updates CHANGELOG.md and optionally updates VERSION in files
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Optional, Tuple
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
||||||
class VersionReleaser:
|
class VersionReleaser:
|
||||||
|
|||||||
@@ -27,10 +27,8 @@ NOTE: Follows Keep a Changelog format, supports Added/Changed/Deprecated/Removed
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ VERSION: 05.00.00
|
|||||||
BRIEF: Validate copyright headers and file information in repository files
|
BRIEF: Validate copyright headers and file information in repository files
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Tuple, Dict
|
from typing import List, Tuple, Dict
|
||||||
|
|||||||
@@ -31,14 +31,13 @@ Exit codes:
|
|||||||
import argparse
|
import argparse
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import pickle
|
import pickle
|
||||||
import sys
|
import sys
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
from dataclasses import dataclass, asdict
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List, Optional, Tuple
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
|
|
||||||
# Version
|
# Version
|
||||||
@@ -146,6 +145,7 @@ class DetectionCache:
|
|||||||
with open(cache_file, 'wb') as f:
|
with open(cache_file, 'wb') as f:
|
||||||
pickle.dump(result, f)
|
pickle.dump(result, f)
|
||||||
except (pickle.PickleError, OSError):
|
except (pickle.PickleError, OSError):
|
||||||
|
|
|||||||
|
# Ignore cache write failures: cache is optional optimization
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def clear(self) -> None:
|
def clear(self) -> None:
|
||||||
@@ -154,6 +154,7 @@ class DetectionCache:
|
|||||||
try:
|
try:
|
||||||
cache_file.unlink()
|
cache_file.unlink()
|
||||||
except OSError:
|
except OSError:
|
||||||
|
'except' clause does nothing but pass and there is no explanatory comment. 'except' clause does nothing but pass and there is no explanatory comment.
```suggestion
except OSError:
# Ignore failures to delete cache files: stale cache entries are non-critical
```
|
|||||||
|
# Ignore failures to delete cache files: stale cache entries are non-critical
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -228,7 +229,6 @@ class PlatformDetector:
|
|||||||
indicators: List[str] = []
|
indicators: List[str] = []
|
||||||
metadata: Dict[str, str] = {}
|
metadata: Dict[str, str] = {}
|
||||||
|
|
||||||
manifest_patterns = ["**/*.xml"]
|
|
||||||
skip_dirs = {".git", "vendor", "node_modules", ".github"}
|
skip_dirs = {".git", "vendor", "node_modules", ".github"}
|
||||||
|
|
||||||
for xml_file in self.repo_path.glob("**/*.xml"):
|
for xml_file in self.repo_path.glob("**/*.xml"):
|
||||||
|
|||||||
@@ -27,12 +27,11 @@ Exit codes:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
import argparse
|
import argparse
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Dict, Tuple, Optional, Any
|
from typing import List, Dict, Optional, Any
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
@@ -113,6 +112,8 @@ class RepositoryStructureValidator:
|
|||||||
elif content.startswith('<?xml') or content.startswith('<'):
|
elif content.startswith('<?xml') or content.startswith('<'):
|
||||||
return "xml"
|
return "xml"
|
||||||
except Exception:
|
except Exception:
|
||||||
|
'except' clause does nothing but pass and there is no explanatory comment. 'except' clause does nothing but pass and there is no explanatory comment.
```suggestion
except Exception:
# Intentionally ignore read/parse errors; fall through to the generic
# "Unable to detect schema format" ValueError raised below.
```
|
|||||||
|
# Intentionally ignore read/parse errors; fall through to the generic
|
||||||
|
# "Unable to detect schema format" ValueError raised below.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Unable to detect format
|
# Unable to detect format
|
||||||
|
|||||||
Reference in New Issue
Block a user
'except' clause does nothing but pass and there is no explanatory comment.