joshcai / leetcode-sync

GitHub Action for syncing LeetCode submissions to GitHub
305 stars 61 forks source link

Action doesn't recognize Oracle as a valid language #6

Closed InfernapeXavier closed 3 years ago

InfernapeXavier commented 3 years ago
Language oraclesql does not have a registered extension.

The mapping for Oracle SQL submissions is missing. Should be an easy fix, just need to change the mapping to:

const LANG_TO_EXTENSION = {
  'bash': 'sh',
  'c': 'c',
  'cpp': 'cpp',
  'csharp': 'cs',
  'golang': 'go',
  'java': 'java',
  'javascript': 'js',
  'kotlin': 'kt',
  'mysql': 'sql',
  'oraclesql': 'sql', //Added this
  'php': 'php',
  'python': 'py',
  'python3': 'py',
  'ruby': 'rb',
  'rust': 'rs',
  'scala': 'scala',
  'swift': 'swift',
};

Suggestion : Logging the error and then skipping the file may be a better way to handle it, instead of failing the Action at this point.

joshcai commented 3 years ago

Thank you for the bug report, @InfernapeXavier! I have created a new release 'v1.3' that should include your suggested fix. Let me know if that doesn't work for you, and I can take another look.

Also, thanks for your suggestion. For some context on why the action explicitly fails - the action was designed to be retriable after any error and to cover all submissions. If we skipped, then even after you re-run the syncer with the new code, the skipped submission would still not be present if a newer submission had already been synced. This way, the user doesn't have to re-create the repo and are also aware of any issues that are present.

InfernapeXavier commented 3 years ago

Everything works properly now.

Thanks!