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

Make generated Python codes free from validate_*() runtime functions #245

Merged
merged 7 commits into from
Mar 13, 2018

Conversation

dahlia
Copy link
Member

@dahlia dahlia commented Mar 10, 2018

This patch basically deals with a part of #160, with several other changes related to it.

See also CHANGES.md.

dahlia added 5 commits March 11, 2018 04:29
Whereas GNU sed's -i/--in-place option optionally takes an argument
(which is a suffix, and means to modify the input file in place if
you omit an argument), BSD sed's -i option always takes an argument
even if it's an empty string (e.g., -i '').

My solution is install GNU sed using Homebrew on macOS build.

Note that omitting --with-default-names will prepend "g" to the
command, i.e., gsed.

Cherry-picked from: nirum-lang#244
@dahlia dahlia added typ:bug Type: Bug/defect typ:enhance Type: Enhancement/new feature typ:refactor Type: Refactoring (i.e., the same feature to end users but its internal change) cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) target:python labels Mar 10, 2018
@dahlia dahlia self-assigned this Mar 10, 2018
@dahlia dahlia requested a review from kanghyojun March 10, 2018 22:22
@checkmate-bot
Copy link

checkmate-bot commented Mar 10, 2018

Checklist 🤔

test/serialization/

  • If any serialization rule is added or changed it should be also updated to docs as well. See also docs/serialization.md, docs/refactoring.md, and so on.

kanghyojun
kanghyojun previously approved these changes Mar 11, 2018
@codecov
Copy link

codecov bot commented Mar 11, 2018

Codecov Report

Merging #245 into master will decrease coverage by 0.55%.
The diff coverage is 90.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #245      +/-   ##
==========================================
- Coverage   73.51%   72.96%   -0.56%     
==========================================
  Files          31       33       +2     
  Lines        2254     2341      +87     
  Branches      126      130       +4     
==========================================
+ Hits         1657     1708      +51     
- Misses        471      503      +32     
- Partials      126      130       +4
Impacted Files Coverage Δ
src/Nirum/Targets/Python/TypeExpression.hs 92.98% <100%> (+0.67%) ⬆️
src/Nirum/Targets/Python/CodeGen.hs 87.75% <100%> (-2.25%) ⬇️
src/Nirum/Targets/Python/Validators.hs 83.13% <83.13%> (ø)
src/Nirum/Targets/Python.hs 89.62% <94%> (-1.34%) ⬇️
..._64-osx/Cabal-2.0.1.0/build/autogen/Paths_nirum.hs 5.88% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f9753c...a38c3da. Read the comment docs.

@dahlia
Copy link
Member Author

dahlia commented Mar 11, 2018

More changes were added:

  • Fixed a runtime TypeError bug caused by name shadowing.
  • Now all integral types are represented as numbers.Integral on Python 2.

@dahlia dahlia merged commit 48faf4f into nirum-lang:master Mar 13, 2018
@dahlia dahlia added this to the Version 0.4.0 milestone May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) target:python typ:bug Type: Bug/defect typ:enhance Type: Enhancement/new feature typ:refactor Type: Refactoring (i.e., the same feature to end users but its internal change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants