mrlvsb / kelvin

Kelvin - The Ultimate Code Examinator
MIT License
25 stars 18 forks source link

Add support for assembly files in MOSS check #452

Closed geordi closed 7 months ago

geordi commented 7 months ago

We're having issue with MOSS check when submitting asm files:

Task 3133: 2024-03-22 17:05:14,683 - INFO - Adding file AAAxxx-5704/asm from submits/...........
Task 3133: 2024-03-22 17:05:14,684 - ERROR - 'AAAxxx-5704/asm'
Traceback (most recent call last):
  File "/srv/kelvin/kelvin/common/moss/__init__.py", line 257, in moss_check_task
    add_submit(logger, moss_client, submit, counters)
  File "/srv/kelvin/kelvin/common/moss/__init__.py", line 113, in add_submit
    add_file(logger, moss, filepath, filename, counters)
  File "/srv/kelvin/kelvin/common/moss/__init__.py", line 70, in add_file
    counters[ALLOWED_EXTENSIONS[ext]] += 1
             ~~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'AAAxxx-5704/asm'
Kobzol commented 7 months ago

The problem is not assembler per-se, the issue is that the file has no extension. I'm not sure how it got past the is_source_valid check though.

geordi commented 7 months ago

OK, I checked it once again and asm files are supported in MOSS. So closing the issue.