Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #8

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ef72151
fix: update artifact path pattern in workflow
jtalborough Oct 14, 2024
439506d
feat: add nuspec file creation and cleanup step in workflow
jtalborough Oct 14, 2024
be6ff44
fix: adjust indentation for nuspec file creation step in workflow
jtalborough Oct 14, 2024
534ac08
feat: add package name validation step in workflow
jtalborough Oct 14, 2024
f623336
feat: add bypass package check input to workflow
jtalborough Oct 14, 2024
c773125
fix: add conditional bypass for package name check in workflow
jtalborough Oct 14, 2024
befbe99
fix: improve error handling for NuGet package checks in workflow
jtalborough Oct 14, 2024
422704f
feat: add commit message check workflow with bypass option
jtalborough Oct 14, 2024
9276785
feat: implement commit message check workflow
jtalborough Oct 14, 2024
a66bdcf
fix: update commit message check to retrieve only the latest commit m…
jtalborough Oct 14, 2024
02264d2
fix: update error handling for package name mismatch in workflow
jtalborough Oct 14, 2024
b1d0153
fix: update expected package name format and improve case-insensitive…
jtalborough Oct 14, 2024
470182f
fix: enhance commit message validation to include merge commit format
jtalborough Oct 15, 2024
b2348c5
fix: update commit message retrieval to only fetch the latest commit …
jtalborough Oct 15, 2024
a4d471c
fix: enhance commit message retrieval and regex patterns for validation
jtalborough Oct 15, 2024
13b39f3
feat: add workflow for automated README updates
jtalborough Oct 15, 2024
829a15a
fix: reorder README section updates for consistency and clarity
jtalborough Oct 16, 2024
a70aad9
fix: improve join parsing logic and enhance markdown generation for c…
jtalborough Oct 29, 2024
0855307
feat: enhance class and join parsing with improved error handling and…
jtalborough Oct 30, 2024
16c3461
Merge branch '1beyond-automate-joinmap' into development
jtalborough Oct 30, 2024
722fea2
feat: enhance class and join parsing with improved regex patterns and…
jtalborough Oct 30, 2024
65d5bf2
feat: enhance class name and base extraction with improved comment ha…
jtalborough Oct 30, 2024
233d18b
feat: optimize join parsing logic and improve performance with cachin…
jtalborough Oct 30, 2024
b5135af
feat(metadata): add feedback extraction to documentation generator
jtalborough Dec 4, 2024
af8cc08
fix(metadata): update feedback extraction regex patterns
jtalborough Dec 4, 2024
681f68e
feat(metadata): update script to capture all feedback types
jtalborough Dec 4, 2024
6aac0b7
fix(workflow): update script path and target directory
jtalborough Dec 4, 2024
79a21f0
fix(workflow): simplify script execution path
jtalborough Dec 4, 2024
af0ee46
fix(workflow): properly handle reusable workflow paths
jtalborough Dec 4, 2024
eca87d0
Merge pull request #10 from PepperDash/add-feedbacks
jtalborough Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: enhance class name and base extraction with improved comment ha…
…ndling and generic type support
jtalborough committed Oct 30, 2024
commit 65d5bf2ec6924dd2b9a4e1217c0680ab8f99d0b4
60 changes: 45 additions & 15 deletions .github/scripts/metadata.py
Original file line number Diff line number Diff line change
@@ -77,28 +77,58 @@ def read_files_in_directory(directory):
def read_class_names_and_bases_from_files(directory):
class_defs = {}
class_pattern = re.compile(
r'^\s*(?:\[[^\]]+\]\s*)*' # Optional attributes
r'^\s*(?:\[[^\]]+\]\s*)*' # Optional attributes
r'(?:public\s+|private\s+|protected\s+)?' # Optional access modifier
r'(?:partial\s+)?' # Optional 'partial' keyword
r'class\s+([A-Za-z_]\w*)' # Class name
r'(?:\s*:\s*([^\{]+))?' # Optional base classes
r'\s*\{', # Opening brace
r'(?:partial\s+)?' # Optional 'partial' keyword
r'class\s+([A-Za-z_]\w*)' # Class name
r'\s*:\s*([^{]+)?' # Capture all base classes after colon
r'\s*{', # Opening brace
re.MULTILINE
)

for root, _, files in os.walk(directory):
for file in files:
if file.endswith('.cs'):
file_path = os.path.join(root, file)
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
for match in class_pattern.finditer(content):
class_name = match.group(1)
bases = match.group(2)
if bases:
base_classes = [b.strip() for b in bases.split(',')]
else:
base_classes = []
class_defs[class_name] = base_classes
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# Remove single-line comments
content = re.sub(r'//.*$', '', content, flags=re.MULTILINE)
# Remove multi-line comments
content = re.sub(r'/\*.*?\*/', '', content, flags=re.DOTALL)

for match in class_pattern.finditer(content):
class_name = match.group(1)
bases = match.group(2)
if bases:
# Split on comma, handle potential generic types properly
base_classes = []
brace_count = 0
current = []

for char in bases:
if char == '<':
brace_count += 1
elif char == '>':
brace_count -= 1
elif char == ',' and brace_count == 0:
base_classes.append(''.join(current).strip())
current = []
continue
current.append(char)

if current:
base_classes.append(''.join(current).strip())

# Clean up base class names
base_classes = [b.split('.')[-1] for b in base_classes]
else:
base_classes = []
class_defs[class_name] = base_classes
except (UnicodeDecodeError, IOError) as e:
print(f"Error reading {file_path}: {e}")
continue
return class_defs

def find_joinmap_classes(class_defs):