Skip to content

Commit

Permalink
Merge pull request #3 from fuzzmaestrotest/master
Browse files Browse the repository at this point in the history
adding a.text
  • Loading branch information
fuzzmaestro1 authored Jan 5, 2024
2 parents 67ba7a1 + 734f4f8 commit aded21d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1
jobs:
semgrep-scan:
parameters:
parameters:
default_branch:
type: string
default: master
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 13 20 * * *
name: Semgrep
jobs:
semgrep:
name: Scan
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci
22 changes: 22 additions & 0 deletions .semgrep/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rules:
- id: avoid_decimal_fields_for_currency_v2
pattern-regex: =.+DecimalField
paths:
include:
- "test.py"
exclude:
- "*/**"
message: >
[best-practice]. Mongo DecimalField is not allowed for representing
currency in models.
Please use common.fields.CurrencyField instead, more context can be found in #currency-fields-v2-migration channel.
Note for PR author: If field that you are adding is not representing currency then feel free to /ignore it, otherwise using new Currency type is mandatory.
languages:
- python
severity: WARNING
metadata:
category: best-practice
rule-origin-note: published from
/src/write-better-python/avoid_decimal_fields_for_currency.yaml in None
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ GEM
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.1)
puma (4.3.5)
puma (4.3.12)
nio4r (~> 2.0)
rack (2.2.3)
rack-livereload (0.3.17)
Expand Down Expand Up @@ -343,7 +343,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.2.1)
zeitwerk (2.2.3)

PLATFORMS
ruby
Expand Down
5 changes: 5 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
field_should_not_get_alert = fields.DecimalField(
blank=True,
precision=2,
precision=3,
)
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

this is a test of pipeline in CircleCI

0 comments on commit aded21d

Please sign in to comment.