Skip to content

Commit

Permalink
Add support for C#
Browse files Browse the repository at this point in the history
  • Loading branch information
fxbru committed Feb 19, 2023
1 parent 257fd61 commit 333170f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/base/util.py
Expand Up @@ -112,6 +112,12 @@ def init_db():
db.session.add(SupportedLanguage(name="Terraform", extensions=".tf"))
db.session.add(SupportedLanguage(name="Generic", extensions=""))
db.session.add(SupportedLanguage(name="Swift", extensions=".swift,.SWIFT"))
db.session.add(
SupportedLanguage(
name="C#",
extensions=".cs,.cshtml,.xaml,.vb,.config,.aspx,.ascx,.asax,.tag,.master,.xml",
)
)
db.session.commit()


Expand Down
3 changes: 2 additions & 1 deletion app/constants.py
Expand Up @@ -78,5 +78,6 @@
"Solidity": "devicon-solidity-plain",
"Terraform": "devicon-terraform-plain",
"Generic": "devicon-devicon-plain",
"Swift": "devicon-swift-plain"
"Swift": "devicon-swift-plain",
"C#": "devicon-csharp-plain"
}
33 changes: 33 additions & 0 deletions migrations/versions/e391e32b3394_3_support_csharp.py
@@ -0,0 +1,33 @@
"""3 SUPPORT CSHARP
Revision ID: e391e32b3394
Revises: 51b79bdb33b2
Create Date: 2023-02-19 14:13:54.745031
"""
from alembic import op
import sqlalchemy as sa

from app import db
from app.rules.models import SupportedLanguage

# revision identifiers, used by Alembic.
revision = "e391e32b3394"
down_revision = "51b79bdb33b2"
branch_labels = None
depends_on = None


def upgrade():
db.session.add(
SupportedLanguage(
name="C#",
extensions=".cs,.cshtml,.xaml,.vb,.config,.aspx,.ascx,.asax,.tag,.master,.xml",
)
)
db.session.commit()


def downgrade():
SupportedLanguage.query.filter_by(name="C#").delete()
db.session.commit()

0 comments on commit 333170f

Please sign in to comment.