Skip to content

fix: escape single quotes in strings in generated Python code #1312

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

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Jan 18, 2025

Closes #1310

Summary of Changes

Single quotes in strings are now escaped in the generated Python code.

Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ REPOSITORY git_diff yes no 0.14s
✅ TYPESCRIPT eslint 1 0 0 4.54s
✅ TYPESCRIPT prettier 1 0 0 1.02s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.72%. Comparing base (88295bc) to head (f54a821).
Report is 26 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1312   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files         119      119           
  Lines       12955    12955           
  Branches     4240     4240           
=======================================
  Hits        12920    12920           
  Misses         35       35           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lars-reimann lars-reimann merged commit 938f082 into main Jan 18, 2025
8 checks passed
@lars-reimann lars-reimann deleted the 1310-invalid-python-code-generated-for-strings-containing-a-single-quote branch January 18, 2025 12:18
lars-reimann pushed a commit that referenced this pull request Mar 8, 2025
## [0.24.0](v0.23.0...v0.24.0) (2025-03-08)

### Features

* global attributes ([#1346](#1346)) ([fda30ab](fda30ab))
* new syntax for template strings ([#1311](#1311)) ([88295bc](88295bc))
* optional parameters must be passed by name ([#1307](#1307)) ([674cda8](674cda8)), closes [#1163](#1163)
* type aliases ([#1334](#1334)) ([3d42bb0](3d42bb0)), closes [#1308](#1308)
* update stubs for library version 0.30.0 ([#1345](#1345)) ([42178d1](42178d1))

### Bug Fixes

* allow callable types and union types in type aliases ([#1342](#1342)) ([b9374b5](b9374b5))
* do not suggest references to type alias ([#1343](#1343)) ([c5ef21d](c5ef21d))
* escape single quotes in strings in generated Python code ([#1312](#1312)) ([938f082](938f082)), closes [#1310](#1310)
* handling of aliases of nullable types ([#1344](#1344)) ([99e1006](99e1006))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid Python code generated for strings containing a single quote
1 participant