Skip to content

Commit f6eb37c

Browse files
ajanitshimangaPouyanpi
authored andcommitted
feat: railsignore - review changes
1 parent e31c391 commit f6eb37c

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

nemoguardrails/rails/llm/config.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,16 +1213,13 @@ def _generate_rails_flows(flows):
12131213

12141214

12151215
def _is_file_ignored_by_railsignore(filename: str) -> bool:
1216-
# Default no skip
1217-
should_skip_file = False
1216+
ignore = False
12181217

12191218
# Load candidate patterns from railsignore
12201219
candidate_patterns = get_railsignore_patterns()
12211220

1222-
# Ignore colang, kb, python modules if specified in valid railsignore glob format
1223-
if filename.endswith(".py") or filename.endswith(".co") or filename.endswith(".kb"):
1224-
for pattern in candidate_patterns:
1225-
if fnmatch.fnmatch(filename, pattern):
1226-
should_skip_file = True
1221+
for pattern in candidate_patterns:
1222+
if fnmatch.fnmatch(filename, pattern):
1223+
ignore = True
12271224

1228-
return should_skip_file
1225+
return ignore

0 commit comments

Comments
 (0)