Skip to content

Commit

Permalink
fix(naming-regressions): fix todos in semgrep-rules related to naming…
Browse files Browse the repository at this point in the history
… regressions (#3444)

* Fix todos

* Deep got beef'd up :muscleemoji:

* bad now good

TODO: actually check if this is not a regression

* fix rule

* Fix misspelling

* trying something

---------

Co-authored-by: Yosef Alsuhaibani <[email protected]>
Co-authored-by: Pieter De Cremer (Semgrep) <[email protected]>
  • Loading branch information
3 people authored Aug 13, 2024
1 parent 57cb8aa commit 34555cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions python/django/maintainability/duplicate-path-assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,29 @@
path('path/to/view', views.other_view, {'def': 'abc'}),
]

# I would prefer duplicate-path-assignment to not match the following test cases
# to avoid giving two messages for the same issue, but could not find a way yet.
# todook: duplicate-path-assignment
# deepok: duplicate-path-assignment
# ruleid: duplicate-path-assignment-different-names, duplicate-path-assignment
urlpatterns = [
path('path/to/view', views.example_view, name="test"),
path('path/to/view', views.example_view, name="other_name"),
]

# todook: duplicate-path-assignment
# deepok: duplicate-path-assignment
# ruleid: duplicate-path-assignment-different-names, duplicate-path-assignment
urlpatterns = [
path('path/to/view', views.example_view, {'abc': 'def'}, name="test"),
path('path/to/view', views.example_view, {'abc': 'def'}, name="other_name"),
]

# todook: duplicate-path-assignment
# deepok: duplicate-path-assignment
# ruleid: duplicate-path-assignment-different-names, duplicate-path-assignment
urlpatterns = [
path('path/to/view', views.example_view, {'abc': 'def'}, name="test"),
path('path/to/other/view', views.other_view, {'abc': 'def'}, name="some_test"),
path('path/to/view', views.example_view, {'abc': 'def'}, name="other_name"),
]

# todook: duplicate-path-assignment
# deepok: duplicate-path-assignment
# ruleid: duplicate-path-assignment-different-names, duplicate-path-assignment
urlpatterns = [
path('path/to/view', views.example_view, {'abc': 'def'}, name="test123"),
Expand Down
1 change: 1 addition & 0 deletions python/requests/security/no-auth-over-http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# ok:no-auth-over-http
good_url = "https://www.github.com"
# deepruleid:no-auth-over-http
bad_url = "http://www.github.com"

# ruleid:no-auth-over-http
Expand Down
2 changes: 1 addition & 1 deletion ruby/rails/security/brakeman/check-sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_more_if_statements
"blah"
end

#ruleid: check-sql
# ruleid: deepok: check-sql
Product.last("blah = '#{x}'")

#ok: check-sql
Expand Down

0 comments on commit 34555cd

Please sign in to comment.