Skip to content

Commit

Permalink
Merge pull request Codium-ai#385 from Codium-ai/hl/fix_add_docs_in_sc…
Browse files Browse the repository at this point in the history
…ripts

Add Blacklist for Non-Editable File Extensions in Documentation
  • Loading branch information
hussam789 authored Oct 19, 2023
2 parents bca293e + 16a97ad commit 086501b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pr_agent/settings/language_extensions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,6 @@ reStructuredText = [".rst", ".rest", ".rest.txt", ".rst.txt", ]
wisp = [".wisp", ]
xBase = [".prg", ".prw", ]

[docs_blacklist_extensions]
# Disable docs for these extensions of text files and scripts that are not programming languages of function, classes and methods
docs_blacklist = ['sql', 'txt', 'yaml', 'json', 'xml', 'md', 'rst', 'rest', 'rest.txt', 'rst.txt', 'mdpolicy', 'mdown', 'markdown', 'mdwn', 'mkd', 'mkdn', 'mkdown', 'sh']
5 changes: 5 additions & 0 deletions pr_agent/tools/pr_add_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ async def run(self):

async def _prepare_prediction(self, model: str):
get_logger().info('Getting PR diff...')

# Disable adding docs to scripts and other non-relevant text files
from pr_agent.algo.language_handler import bad_extensions
bad_extensions += get_settings().docs_blacklist_extensions.docs_blacklist

self.patches_diff = get_pr_diff(self.git_provider,
self.token_handler,
model,
Expand Down

0 comments on commit 086501b

Please sign in to comment.