Skip to content

Commit

Permalink
Allow overriding lang config
Browse files Browse the repository at this point in the history
  • Loading branch information
shino16 authored Jan 8, 2021
1 parent c73a7ff commit ac15e80
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions onlinejudge_verify/languages/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ def _get_dict() -> Dict[str, Language]:
_dict['.rs'] = RustLanguage()

for ext, config in get_config().get('languages', {}).items():
if '.' + ext in _dict:
if not isinstance(_dict['.' + ext], UserDefinedLanguage):
for key in ('compile', 'execute', 'bundle', 'list_attributes', 'list_dependencies'):
if key in config:
raise RuntimeError("You cannot overwrite existing language: .{}".format(ext))
else:
logger.warning("config.toml: languages.%s: Adding new languages using `config.toml` is supported but not recommended. Please consider making pull requests for your languages, see https://github.com/kmyk/online-judge-verify-helper/issues/116", ext)
_dict['.' + ext] = UserDefinedLanguage(extension=ext, config=config)
logger.warning("config.toml: languages.%s: Adding new languages using `config.toml` is supported but not recommended. Please consider making pull requests for your languages, see https://github.com/kmyk/online-judge-verify-helper/issues/116", ext)
_dict['.' + ext] = UserDefinedLanguage(extension=ext, config=config)
return _dict


Expand Down

0 comments on commit ac15e80

Please sign in to comment.