Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghc 9.2.8 upgrade for plugins with backward compatibility #20

Open
wants to merge 92 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
dbd1d08
additional overall expr type info in ArgTypeBlocked violation and add…
piyushgarg-juspay Jun 12, 2024
cabe895
Merge branch 'main' of github.com:juspay/spider into sheriff/show-onl…
piyushgarg-juspay Jun 24, 2024
6454e6c
sheriff fixes and keeping it show only
piyushgarg-juspay Jun 24, 2024
f0f0c9f
moved rdp and large-records for ordering
Jun 25, 2024
0fbb3a8
fixed tests
Jun 25, 2024
0b747fb
tests fixed
Jun 25, 2024
43bb027
handled
Jun 25, 2024
c62efb1
build fix
Jun 25, 2024
6db5657
bumped large-records
Jun 25, 2024
4f02488
adding srcLoc
Jun 26, 2024
66663b6
fixed srcLoc
Jun 26, 2024
11d0c2b
added srcSpan in name to have uniqueness
Jun 26, 2024
87129b2
build issue
Jun 27, 2024
f1cbce9
merging code_string from parser dump
Jun 27, 2024
b4e4d09
creating dir
Jun 27, 2024
e8807c4
added cabal flag enable-lr-plugins
Jun 27, 2024
f72dca1
added cabal flag enable-lr-plugins for fieldInspector
Jun 27, 2024
844b7e8
evaluate added in fdep
Jun 27, 2024
e2bfbc9
removed beautified strings collection from TC
Jul 1, 2024
f6906c3
fieldInspector cabal issue
Jul 1, 2024
c3a0ea4
filtering duplicates
Jul 4, 2024
ed18ef5
handled case extraction of types
Jul 4, 2024
0f9cf85
changed to Text and removed forkIO at toplevel
Jul 5, 2024
2ad5b7c
added SHOULD_FORK env
Jul 5, 2024
31f3569
enabled forkIO in fdep bydefault
Jul 10, 2024
460f4f0
moved logs to under env
Jul 10, 2024
fe96532
added python code to merge fdep output
Jul 10, 2024
e84d86a
fixied CPP file path issue
Jul 11, 2024
92e3771
added env to generate fdep GENERATE_FDEP
Jul 12, 2024
5075813
added runClient under try
Jul 12, 2024
8420efa
Merge branch 'main' of https://github.com/juspay/spider into rdp
Jul 16, 2024
f86d2d7
moving to ghc928
Jul 19, 2024
928b075
added GHC 9.2.8 support
Jul 22, 2024
842f868
fixed for GHC 8.10.7 as well
Jul 23, 2024
d4adf4e
bumped references post fixing TH code
Jul 24, 2024
43064d9
testing with streamly core
Jul 25, 2024
bb2da8f
GHC 9.2.8 upgrade and refactor for template plugins
piyushgarg-juspay Jul 24, 2024
16fec61
Remove kvdb rule enforcement as of now
piyushgarg-juspay Jul 24, 2024
41c2ccc
Fix redundant rule due to src_span and add beam as input
piyushgarg-juspay Jul 24, 2024
6dce0a8
override beam in large-records
piyushgarg-juspay Jul 25, 2024
b3927c7
Keep both ghc 8 and ghc 9 support in flake
piyushgarg-juspay Jul 26, 2024
e0f1cb1
Fix for particular cases for operators in HsExpansion
piyushgarg-juspay Jul 29, 2024
fbfabc6
Added paymentFlow plugin
harshithakharsha Aug 12, 2024
49832cb
Merge pull request #22 from juspay/paymentflow-support
aravindgopall Aug 12, 2024
cb0d84a
Added paymentFlow related modules to other modules in cabal file
harshithakharsha Aug 21, 2024
dbed93b
Commented test suite support
harshithakharsha Aug 21, 2024
bf89071
removed logs
Aug 21, 2024
6141c53
Merge pull request #23 from juspay/support-other-modules-in-cabal-file
aravindgopall Aug 22, 2024
42cba14
added AST for HsCase
Aug 6, 2024
732f3ad
added if else
Aug 23, 2024
0c52287
Add qualified function support and update doc
piyushgarg-juspay Aug 24, 2024
2e81e4f
added api-contract plugin - ghc9.2.8
Aug 27, 2024
faae2ac
removed logs from fdep
Aug 27, 2024
7b53720
Merge pull request #24 from juspay/api-contract
aravindgopall Aug 27, 2024
532c0c9
added instance for typeCheckResultAction
Aug 28, 2024
afad8f2
automatically generating yaml files for new files
Aug 28, 2024
4e4b407
handled XExpr
Sep 4, 2024
5169623
fixed for ghc8107
Sep 5, 2024
df19c63
added text
Sep 5, 2024
71baf1c
generating files
Sep 6, 2024
1bf106b
Add support for multiple functions in single rule
piyushgarg-juspay Sep 11, 2024
b68ac82
Merge pull request #25 from juspay/sheriff/enhancements
aravindgopall Sep 11, 2024
52ef8c3
Fix duplicate errors for FnUseBlocked violation
piyushgarg-juspay Sep 12, 2024
2107cb5
Merge pull request #26 from juspay/sheriff/enhancements
aravindgopall Sep 12, 2024
d86041d
Domain checker plugin
Chaitanya064 Sep 13, 2024
4c73fe0
Merge pull request #27 from juspay/domain/sync
aravindgopall Sep 13, 2024
9f462f9
Fixes for 8107
Chaitanya064 Sep 13, 2024
82e1a72
Merge pull request #28 from juspay/domain/sync
Chaitanya-nair Sep 13, 2024
e55f959
Merge pull request #29 from juspay/api-contract
aravindgopall Sep 16, 2024
5dc621a
Add support for function signature blocked, wildcard character & rule…
piyushgarg-juspay Sep 16, 2024
a5015f7
Add derived signature from argument types
piyushgarg-juspay Sep 17, 2024
dab36f6
Merge pull request #30 from juspay/sheriff/enhancements
piyushgarg-juspay Sep 17, 2024
751a4e1
Fix flake.lock - beam input not found
piyushgarg-juspay Sep 17, 2024
4190336
Remove wildcard from function name check
piyushgarg-juspay Sep 17, 2024
d816482
Fix sheriff wildcard character
piyushgarg-juspay Sep 18, 2024
af2ddda
Fix rules not applied on module names with dot
piyushgarg-juspay Sep 18, 2024
a440478
sheriff[refactor]: Refactor test suite to include sub tests
piyushgarg-juspay Sep 23, 2024
ca17875
sheriff[refactor]: Refactor plugin code and test suite to include inf…
piyushgarg-juspay Sep 23, 2024
905a19b
sheriff[refactor]: Refactor plugin and test cases
piyushgarg-juspay Sep 23, 2024
efb9686
sheriff[feature]: Add infinite recursion detection with minor refacto…
piyushgarg-juspay Sep 30, 2024
7177f53
Merge pull request #31 from juspay/sheriff/enhancements
aravindgopall Oct 1, 2024
0d4088b
sheriff[fix]: Module name matching when comparing function name for i…
piyushgarg-juspay Oct 1, 2024
c8e3e2c
sheriff[fix]: Add type signature check for determining if it is infin…
piyushgarg-juspay Oct 1, 2024
f3b0239
sheriff[fix]: Explicitly remove constraint matching when transforming…
piyushgarg-juspay Oct 2, 2024
70722ae
Merge pull request #33 from juspay/sheriff/enhancements
aravindgopall Oct 3, 2024
77c0dda
sheriff[fix + improvement]: fix false positive for infinite recursion…
piyushgarg-juspay Oct 4, 2024
c619184
Merge pull request #34 from juspay/sheriff/enhancements
aravindgopall Oct 7, 2024
a1214fd
sheriff[fix]: Resolve to top most name for function name matching
piyushgarg-juspay Oct 9, 2024
7634ae2
sheriff[fix]: Fix DB Rules not getting applied
piyushgarg-juspay Oct 9, 2024
e160add
sheriff[fix]: Fix DB Rules not working for GHC-9
piyushgarg-juspay Oct 10, 2024
0d7f7a2
sheriff[add]: Add exceptions to DB index rules
piyushgarg-juspay Oct 10, 2024
94b55fb
Merge pull request #35 from juspay/sheriff/enhancements
aravindgopall Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist-*
result
cabal.project.local
cabal.project.local
tmp*
.DS_STORE
5 changes: 5 additions & 0 deletions api-contract/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist*
result
dist-newstyle
result
tmp*
59 changes: 59 additions & 0 deletions api-contract/.juspay/api-contract/test/Main.hs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
RefundAttempt:
caseType: null
dataConstructors:
RefundAttempt:
fields':
created: Text
error_code: Maybe Value
error_message: Maybe Text
id': Maybe Text
last_modified: Maybe Text
ref: Maybe Text
sumTypes: []
instances:
parseJSON:
fieldsList:
- id'
- created
- ref
- error_message
- error_code
- last_modified
typeOfInstance: Custom
toEncoding:
fieldsList:
- id'
- created
- ref
- error_message
- error_code
- last_modified
typeOfInstance: Custom
toJSON:
fieldsList: []
typeOfInstance: Derived
typeKind: data

RefundAttempt':
caseType: null
dataConstructors:
RefundAttempt':
fields':
created'': Text
error_code'': Maybe Value
error_message'': Maybe Text
id'': Maybe Text
last_modified'': Maybe Text
ref'': Maybe Text
sumTypes: []
instances:
parseJSON:
fieldsList: []
typeOfInstance: Derived
toEncoding:
fieldsList: []
typeOfInstance: Derived
toJSON:
fieldsList: []
typeOfInstance: Derived
typeKind: data
5 changes: 5 additions & 0 deletions api-contract/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Revision history for api-contract

## 0.1.0.0 -- YYYY-mm-dd

* First version. Released on an unsuspecting world.
20 changes: 20 additions & 0 deletions api-contract/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2024 eswar2001

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
86 changes: 86 additions & 0 deletions api-contract/api-contract.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
cabal-version: 3.0
name: api-contract
version: 0.1.0.0
-- synopsis:
-- description:
license: MIT
license-file: LICENSE
author: eswar2001
maintainer: [email protected]
-- copyright:
category: Control
build-type: Simple
extra-doc-files: CHANGELOG.md
data-files: .juspay/api-contract/**/*.hs.yaml
-- extra-source-files:

flag enable-isolation
description: set this flag to enable these plugins Data.Record.Plugin , Data.Record.Anon.Plugin , Data.Record.Plugin.HasFieldPattern
default: False
manual: True

common warnings
if flag(enable-isolation)
cpp-options: -DENABLE_ISOLATION
ghc-options: -Wall

library
import: warnings
exposed-modules:
ApiContract.Plugin
, ApiContract.Types
-- other-modules:
-- other-extensions:
build-depends:
bytestring
, containers
, filepath
, ghc
, unordered-containers
, aeson
, directory
, extra
, aeson-pretty
, base
, text
, base64-bytestring
, optparse-applicative
, deepseq
, time
, async
, cryptonite
, hasbolt
, universum
, streamly-core
, data-default
, large-records
, large-generics
, large-anon
, ghc-hasfield-plugin
, record-dot-preprocessor
, ghc-tcplugin-api
, typelet
, record-hasfield
, binary
, references
, uniplate
, yaml

hs-source-dirs: src
default-language: Haskell2010

test-suite api-contract-test
import: warnings
default-language: Haskell2010
ghc-options: -fplugin=ApiContract.Plugin
-- other-modules:
-- other-extensions:
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
build-depends:
base
, api-contract
, aeson
, record-hasfield
, text
Loading