Skip to main content

Polyglot Piranha is a library for performing structural find and replace with deep cleanup.

Project description

Piranha

Join the chat at https://gitter.im/uber/piranha

Feature flags are commonly used to enable gradual rollout or experiment with new features. In a few cases, even after the purpose of the flag is accomplished, the code pertaining to the feature flag is not removed. We refer to such flags as stale flags. The presence of code pertaining to stale flags can have the following drawbacks:

  • Unnecessary code clutter increases the overall complexity w.r.t maintenance resulting in reduced developer productivity
  • The flags can interfere with other experimental flags (e.g., due to nesting under a flag that is always false)
  • Presence of unused code in the source as well as the binary
  • Stale flags can also cause bugs

Piranha is a tool to automatically refactor code related to stale flags. At a higher level, the input to the tool is the name of the flag and the expected behavior, after specifying a list of APIs related to flags in a properties file. Piranha will use these inputs to automatically refactor the code according to the expected behavior.

This repository contains four independent versions of Piranha, one for each of the four supported languages: Java, JavaScript, Objective-C and Swift. It also contains a redesigned variant of Piranha (as of May 2022) that is a common refactoring tool to support multiple languages and feature flag APIs. If interested in this polyglot variant, goto Polyglot Piranha.

To use/build each version, look under the corresponding [lang]/ directory and follow instructions in the corresponding [lang]/README.md file. Make sure to cd into that directory to build any related code following the instructions in the README.

A few additional links on Piranha:

  • Research paper published at PLDI 2024 on PolyglotPiranha.
  • A technical report detailing our experiences with using Piranha at Uber.
  • A blogpost presenting more information on Piranha.
  • 6 minute video overview of Piranha.

Support

If you have any questions on how to use Piranha, please feel free to reach out to us on the gitter channel. For bugs and enhancement requests, open a GitHub issue.

Contributors

We'd love for you to contribute to Piranha! Please note that once you create a pull request, you will be asked to sign our Uber Contributor License Agreement.

We are also looking for contributions to extend Piranha to other languages (C++, C#, Kotlin).

License

Piranha is licensed under the Apache 2.0 license. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyglot_piranha-0.3.26.tar.gz (160.3 kB view details)

Uploaded Source

Built Distributions

polyglot_piranha-0.3.26-cp312-cp312-manylinux_2_34_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.34+ ARM64

polyglot_piranha-0.3.26-cp312-cp312-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.26-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.3 MB view details)

Uploaded CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

polyglot_piranha-0.3.26-cp311-cp311-manylinux_2_34_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.34+ ARM64

polyglot_piranha-0.3.26-cp311-cp311-manylinux_2_28_x86_64.whl (17.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.26-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.3 MB view details)

Uploaded CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

polyglot_piranha-0.3.26-cp310-cp310-manylinux_2_34_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.34+ ARM64

polyglot_piranha-0.3.26-cp310-cp310-manylinux_2_28_x86_64.whl (17.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.26-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.3 MB view details)

Uploaded CPython 3.10 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

polyglot_piranha-0.3.26-cp39-cp39-manylinux_2_34_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.34+ ARM64

polyglot_piranha-0.3.26-cp39-cp39-manylinux_2_28_x86_64.whl (17.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.26-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.3 MB view details)

Uploaded CPython 3.9 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

polyglot_piranha-0.3.26-cp38-cp38-manylinux_2_34_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ ARM64

polyglot_piranha-0.3.26-cp38-cp38-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.26-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.3 MB view details)

Uploaded CPython 3.8 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

File details

Details for the file polyglot_piranha-0.3.26.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.26.tar.gz
  • Upload date:
  • Size: 160.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for polyglot_piranha-0.3.26.tar.gz
Algorithm Hash digest
SHA256 362c23cd6e64c00787449e77d23a2430801bf5e549e46a94465b4789474cb85a
MD5 50dd86f05043214d1049dfd69f741d26
BLAKE2b-256 74337aaac5292bec0744170621ab9d039752eeb66a9d089784e0ca03636b4025

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 ee4bcc83d5154b0d8f92226ea9300f2e88e1d28e83cd766545e2f1a8120e0de1
MD5 c1e7ba328f69670ec6dcee6db5b1335d
BLAKE2b-256 bdb9a616b4fac9f3a6c89493398595cb987701e65d07fec8d5e0daaa765cbc7c

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 63fc65ab3a3ada89419c8492fe850845de5f2f8c892db5946ab52cf423020f1c
MD5 870ea49852e8b2e85737c6c7cef9810d
BLAKE2b-256 c82285fc2b4a48db7e13b391c2978cc67370e5f9ef6884969c895213c9bd2601

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 4cfdbf53e0b30d19add5b21d95d3f795c4789698808700e968285d56399838b0
MD5 382fa239f9f93945111931ccd4a9402b
BLAKE2b-256 b7457a7cf7bad69f9cc23bb5dab3683de5cf72d50c1cf45ccd85e8f745f4fabd

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d5dd7aaff36bc69b670eeeae07af72f199b9705b26c4ec2ecc8f1d2706ba3a6e
MD5 3b0a8110177330858ff3003a2ce25bb0
BLAKE2b-256 5db5d6bcb3d0b64bc430507b1d43d2e4950c89d15452f841cb4b95740938dc99

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dd5828343099c30ccb1d12bb75a4b038780a02d7aadbd8e5318a79611e9a2041
MD5 d321c1895ec81ecadf181b308a457600
BLAKE2b-256 61660b6c72781dc15327e7306c82d02eea068f6ba42885504370f2b08e740833

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 e7eb93b6e524bfb1b0699e316e7927ad8c68f0aaed36d32a423c5d45164f1c54
MD5 ca1d3c861ea9c8ac1e6646fbe9d55e2e
BLAKE2b-256 f4e40e55266b54c4e14fa31a01063725fa8360b4fe310bc31041d180d4fb35f6

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 ea86e1937fc6d9382e7cdbb11a743721738c626e70d350fd08e1035ec94fb4a9
MD5 0f2eb1266efc01dc59a4db4977fbce22
BLAKE2b-256 d26373c1e2447ce05066fb485cc8ca93136a5c958ebeb49223ddccbacb2bf416

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a8484fee773159b9b2c67908a27ee9883a084fc77dc1b95cb8a91e5bc00fd6b
MD5 0d6f0f23f22c8c200f8b61fbd58a0fda
BLAKE2b-256 4462c78f0d8b1130519f1e80946e2391cd5d0545dd4a094adcb88fa9e6655212

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 942b134f59c147aa448cc4d707400c7d3ba1864c26c8664549d879aec27673e0
MD5 2a5eeca6f7d3aa0f5d4a530e4880c426
BLAKE2b-256 7b01e2c1f365c5843f4a8c1fd3e03ca5b2850b7710402452ce8cbb8c3380bee9

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp39-cp39-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp39-cp39-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fedd7c5e3d674c871511fdb516e884f7d057363b5ee023f9cd7d48e3fe215130
MD5 f373cefd71ff3c1274a09d7529761963
BLAKE2b-256 7d6a97502cd9beb0da277dca19d25af594b7719430a281f6a543d25b96d9442d

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e7019a301549b420e7638bbe255a153165e625bebed479544401fa6135ab4133
MD5 772c5dd181b8e6ffaa1a0cac1e2086a5
BLAKE2b-256 8747f45a5631b33b1ddd60d6d6aecaeda959de95d09216c68f21195e66a1194f

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 5e5874c39bb17a26fe7f18d8016d81b3da861b26c63cc6712caac3b93dbf2044
MD5 f52f676930bcea4e65ab61ab3dbf15ad
BLAKE2b-256 cf756dd68869f8b83deaa01b9f55c2f58683541a9fb3b3fc1173264265d8a194

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp38-cp38-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp38-cp38-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 8bd2a4c44e22b7865f56d750838569bdf2545e7c0d04f0931bb37b043fa3562b
MD5 657cfb27c322c707c30ed785cbe13db2
BLAKE2b-256 8d699a7b43c3a1e9e80214acdb4e3fb65d880dd66aec32d1e4d81986605c5d4b

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bfe4fb491b284660893196b1f7a28221d2d3f3db6862cb58be51c93f39762a58
MD5 ad2b25b9cf86791c53cad3611dd855f4
BLAKE2b-256 f6134ebd642e6a1b72ef34a998e4f9669541280e6538b00c0e50d5395c454d6b

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.26-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.26-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 82e7f533638ad1f337a1f18c5469ee4e51f9f2ce219166ceb002e51991576b95
MD5 902a9877ae845cb7a5e62f4c6a0fdf40
BLAKE2b-256 e24ea9f9912ff826a453f798299d2d543b361c01aee4d8ecbdf57679ddfb9b76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page