git.iko.soy/typeable/libphonenumber
on 80c4cf1 help sign in
.github/workflows/ci.yaml+7−10
since splitsnapshots
unifiedsplit
@@ -24,17 +24,14 @@ jobs:
24 - "9.0.2"
24 - "9.0.2"
25 - "9.2.8"
25 - "9.2.8"
26 - "9.4.8"
26 - "9.4.8"
27− - "9.6.7"
27+ - "9.6.3"
28− - "9.8.4"
28+ - "9.8.1"
29− - "9.10.3"
30− - "9.12.2"
31− - "9.14.1"
32 fail-fast: false
29 fail-fast: false
33 name: Build on Linux, GHC ${{ matrix.ghc_version }}
30 name: Build on Linux, GHC ${{ matrix.ghc_version }}
34 runs-on: ${{ matrix.platform }}
31 runs-on: ${{ matrix.platform }}
35 steps:
32 steps:
36− - uses: actions/checkout@v4
33+ - uses: actions/checkout@v3
37− - uses: haskell-actions/setup@v2
34+ - uses: haskell/actions/setup@v2
38 with:
35 with:
39 ghc-version: ${{ matrix.ghc_version }}
36 ghc-version: ${{ matrix.ghc_version }}
40 cabal-version: "3.10.1.0"
37 cabal-version: "3.10.1.0"
@@ -70,7 +67,7 @@ jobs:
70 if: github.event_name == 'release'
67 if: github.event_name == 'release'
71 steps:
68 steps:
72 - uses: actions/checkout@v3
69 - uses: actions/checkout@v3
73− - uses: haskell-actions/setup@v2
70+ - uses: haskell/actions/setup@v2
74 with:
71 with:
75 cabal-version: "3.10.1.0"
72 cabal-version: "3.10.1.0"
76 - name: Install C++ library
73 - name: Install C++ library
@@ -85,11 +82,11 @@ jobs:
85 run: |
82 run: |
86 cabal haddock --builddir "$GITHUB_WORKSPACE/doc" --haddock-for-hackage --enable-doc
83 cabal haddock --builddir "$GITHUB_WORKSPACE/doc" --haddock-for-hackage --enable-doc
87 echo "docs=$(find "$GITHUB_WORKSPACE/doc" -maxdepth 1 -type f -name '*-docs.tar.gz')" >> "$GITHUB_ENV"
84 echo "docs=$(find "$GITHUB_WORKSPACE/doc" -maxdepth 1 -type f -name '*-docs.tar.gz')" >> "$GITHUB_ENV"
88− - uses: actions/upload-artifact@v6
85+ - uses: actions/upload-artifact@v2
89 with:
86 with:
90 name: Source tarball
87 name: Source tarball
91 path: ${{ env.dist }}
88 path: ${{ env.dist }}
92− - uses: svenstaro/upload-release-action@2.11.3
89+ - uses: svenstaro/upload-release-action@2.2.1
93 with:
90 with:
94 repo_token: ${{ secrets.GITHUB_TOKEN }}
91 repo_token: ${{ secrets.GITHUB_TOKEN }}
95 file: ${{ env.dist }}
92 file: ${{ env.dist }}
libphonenumber.cabal+8−11
@@ -1,6 +1,6 @@
1cabal-version: 3.0
1cabal-version: 3.0
2name: libphonenumber
2name: libphonenumber
3−version: 0.1.4.0
3+version: 0.1.2.0
4category: Data
4category: Data
5synopsis: Parsing, formatting, and validating international phone
5synopsis: Parsing, formatting, and validating international phone
6 numbers
6 numbers
@@ -25,7 +25,7 @@ description:
25 and to avoid a dependency on @text@, we use 'ByteString'
25 and to avoid a dependency on @text@, we use 'ByteString'
26 throughout the library instead of 'Data.Text.Text'.
26 throughout the library instead of 'Data.Text.Text'.
27
27
28−copyright: 2023-2025 Typeable
28+copyright: 2023 Typeable
29author: Typeable
29author: Typeable
30maintainer: mniip@typeable.io
30maintainer: mniip@typeable.io
31homepage: https://github.com/typeable/libphonenumber/
31homepage: https://github.com/typeable/libphonenumber/
@@ -39,11 +39,8 @@ tested-with:
39 , GHC == 9.0.2
39 , GHC == 9.0.2
40 , GHC == 9.2.8
40 , GHC == 9.2.8
41 , GHC == 9.4.8
41 , GHC == 9.4.8
42− , GHC == 9.6.7
42+ , GHC == 9.6.3
43− , GHC == 9.8.4
44− , GHC == 9.10.3
45− , GHC == 9.12.2
43+ , GHC == 9.8.1
46− , GHC == 9.14.1
47
44
48build-type: Simple
45build-type: Simple
49
46
@@ -64,13 +61,12 @@ library
64 , Data.PhoneNumber.Internal.Number
61 , Data.PhoneNumber.Internal.Number
65 , Data.PhoneNumber.Internal.Util
62 , Data.PhoneNumber.Internal.Util
66 build-depends:
63 build-depends:
67− , base >= 4.12 && < 4.23
64+ , base >= 4.12 && < 4.20
68 , bytestring >= 0.10.8 && < 0.13
65 , bytestring >= 0.10.8 && < 0.13
69− , containers >= 0.6.0 && < 0.9
66+ , containers >= 0.6.0 && < 0.8
70 , deepseq >= 1.4.4 && < 1.6
67 , deepseq >= 1.4.4 && < 1.6
71 , transformers >= 0.5.5 && < 0.7
68 , transformers >= 0.5.5 && < 0.7
72 build-tool-depends: c2hs:c2hs
69 build-tool-depends: c2hs:c2hs
73− pkgconfig-depends: protobuf
74 include-dirs: include
70 include-dirs: include
75 includes:
71 includes:
76 , c_phonenumber.h
72 , c_phonenumber.h
@@ -80,6 +76,7 @@ library
80 , cxxbits/c_phonenumberutil.cpp
76 , cxxbits/c_phonenumberutil.cpp
81 extra-libraries:
77 extra-libraries:
82 , phonenumber
78 , phonenumber
79+ , protobuf
83 if impl(ghc >= 9.4)
80 if impl(ghc >= 9.4)
84 build-depends: system-cxx-std-lib
81 build-depends: system-cxx-std-lib
85 else
82 else
@@ -111,7 +108,7 @@ test-suite spec_test
111 , containers
108 , containers
112 , hspec >= 2.10.8 && < 2.12
109 , hspec >= 2.10.8 && < 2.12
113 , libphonenumber
110 , libphonenumber
114− , QuickCheck >= 2.13.1 && < 2.16
111+ , QuickCheck >= 2.13.1 && < 2.15
115 main-is: Spec.hs
112 main-is: Spec.hs
116 hs-source-dirs: test
113 hs-source-dirs: test
117 default-language: Haskell2010
114 default-language: Haskell2010
test/Spec.hs+9−3
@@ -125,9 +125,15 @@ main = hspec $ modifyMaxSuccess (* 10) $ do
125 prop "returns only ASCII digits" $ \(ParsedNumber _ pn) ->
125 prop "returns only ASCII digits" $ \(ParsedNumber _ pn) ->
126 BSC.all (`elem` ['0'..'9']) $ nationalSignificantNumber pn
126 BSC.all (`elem` ['0'..'9']) $ nationalSignificantNumber pn
127 modifyMaxDiscardRatio (* 10) $ do
127 modifyMaxDiscardRatio (* 10) $ do
128− prop "concatenated with country code parses to the original (if valid)" $
128+ prop "concatenated with country code parses to the original (if valid and not MX)" $
129− \(ParsedNumber _ pn) ->
129+ \(ParsedNumber (_, mReg, ParserInput input) pn) ->
130+ -- Apparently "+52112210000000" makes the parser/formatter do weird
131+ -- stuff as it tries to handle the deprecated (?) mobile token ("1"
132+ -- after "+52")
133+ if "5211" `BS.isPrefixOf` normalizeNumber Digits input ||
134+ mReg == Just "MX" && "11" `BS.isPrefixOf` normalizeNumber Digits input
135+ then discard
130− isValidNumber Nothing pn ==>
136+ else isValidNumber Nothing pn ==>
131 let
137 let
132 cc = countryCode pn
138 cc = countryCode pn
133 nsn = nationalSignificantNumber pn
139 nsn = nationalSignificantNumber pn