Skip to content

Commit 8e6f687

Browse files
committed
[docs] Enhance Copilot instructions
1 parent 2f7db38 commit 8e6f687

File tree

2 files changed

+7
-49
lines changed

2 files changed

+7
-49
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -237,50 +237,7 @@ Scripts scan `__metadata__/connector_manifest.json` files and consolidate them.
237237
6. **Docker networking** - Locally, connectors expect `docker_default` network
238238
7. **Environment variables** - Use `.env.sample` as template, never commit secrets
239239

240-
## Code Review & PR Submission
241-
242-
**When reviewing code, focus on:**
243-
244-
### Security Critical Issues
245-
- Check for hardcoded secrets, API keys, or credentials
246-
- Look for SQL injection and XSS vulnerabilities
247-
- Verify proper input validation and sanitization
248-
- Review authentication and authorization logic
249-
250-
### Performance Red Flags
251-
- Identify N+1 database query problems
252-
- Spot inefficient loops and algorithmic issues
253-
- Check for memory leaks and resource cleanup
254-
- Review caching opportunities for expensive operations
255-
256-
### Code Quality Essentials
257-
- Functions should be focused and appropriately sized
258-
- Use clear, descriptive naming conventions
259-
- Ensure proper error handling throughout
260-
261-
### Review Style
262-
- Be specific and actionable in feedback
263-
- Explain the "why" behind recommendations
264-
- Acknowledge good patterns when you see them
265-
- Ask clarifying questions when code intent is unclear
266-
267-
Always prioritize security vulnerabilities and performance issues that could impact users.
268-
269-
Always suggest changes to improve readability. For example:
270-
271-
```python
272-
# Instead of:
273-
if user.email and '@' in user.email and len(user.email) > 5:
274-
submit_button.enabled = True
275-
else:
276-
submit_button.enabled = False
277-
278-
# Consider:
279-
def is_valid_email(email):
280-
return email and '@' in email and len(email) > 5
281-
282-
submit_button.enabled = is_valid_email(user.email)
283-
```
240+
## PR Submission
284241

285242
**Before submitting a PR:**
286243

external-import/threatfox/src/__main__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def import_data(self, state: Dict, now_dt: datetime, now_ts: int) -> None:
164164
last_processed_entry_running_max = last_processed_entry
165165

166166
for i, row in enumerate(csv_reader):
167-
if len(row) > 14:
167+
if len(row) > 15:
168168
self.helper.log_info(
169169
f"The csv line is badly formatted and will be ignored.(line: {i}, data: {row})"
170170
)
@@ -532,18 +532,19 @@ def __init__(self, row: Tuple) -> None:
532532
self.last_seen = None
533533

534534
self.confidence_level = int(row[9])
535-
self.reference = row[10]
535+
self.is_compromised = str(row[10]).lower() == "true"
536+
self.reference = row[11]
536537

537538
if self.reference == "None":
538539
self.reference = ""
539540

540-
self.tags = list(filter(None, row[11].split(",")))
541+
self.tags = list(filter(None, row[12].split(",")))
541542

542543
if self.threat_type:
543544
self.tags.insert(0, self.threat_type)
544545

545-
self.anonymous = bool(int(row[12]))
546-
self.reporter = row[13]
546+
self.anonymous = bool(int(row[13]))
547+
self.reporter = row[14]
547548

548549

549550
if __name__ == "__main__":

0 commit comments

Comments
 (0)