Polyglot Piranha is a library for performing structural find and replace with deep cleanup.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file polyglot_piranha-0.3.25.tar.gz
.
File metadata
- Download URL: polyglot_piranha-0.3.25.tar.gz
- Upload date:
- Size: 160.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3e2188ddc73742cccdc286275e24953a8af700656c749cc06b9118a03b0bcfe |
|
MD5 | 3caf1c10e1fd631e1c04022b5c3702e5 |
|
BLAKE2b-256 | 47f0a469854fce34bf9e0f46d1ab63d52602a57a783b9813c5258cfb8eec0be2 |
File details
Details for the file polyglot_piranha-0.3.25-cp312-cp312-manylinux_2_34_aarch64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp312-cp312-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d4b8cacdec31db78692d0387300e45edad788d879a44f772635bb5e204b8d8b |
|
MD5 | ff559eb21fa5f4a38b58a62cff29df59 |
|
BLAKE2b-256 | 64facb99bf27cfe5da57d9aa4d71c8e70d086883a59495338582680e95d2ce7e |
File details
Details for the file polyglot_piranha-0.3.25-cp312-cp312-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e4f18fe2241fd02ae535c50f7484e495e4cc218835bdd7b244c71bbb73272ae |
|
MD5 | cedc5b663dc289d5ecdef403a6133d15 |
|
BLAKE2b-256 | f21d139e3faa8fa0893fae9119c55f7cc5d2aa4530558eececdbdf0283270c57 |
File details
Details for the file polyglot_piranha-0.3.25-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.12, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a64d3a8b8ca5c5dd30f141f0634fd9b147764b5ad3a2d4b712a44220080a7483 |
|
MD5 | c857a215cfd4826fe57df1343d77b8a3 |
|
BLAKE2b-256 | 4f8459f8c8d9b7d4926882f59ec240c5012ceeb6b880ff009b47dbfd39a2d66f |
File details
Details for the file polyglot_piranha-0.3.25-cp311-cp311-manylinux_2_34_aarch64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp311-cp311-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ade498ff7e408819a81ffb202f298966bbed4dee5b11819d3516fc22ce56dfd |
|
MD5 | 42b538662f449d8f0c9b88ccfdf838e1 |
|
BLAKE2b-256 | 31c1320b3317798f00360154335eb84500413b08d208eb82f061091b3b32108e |
File details
Details for the file polyglot_piranha-0.3.25-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3802d459bd4f580136dbbfa08b3ba63572b78033d27fbb04d9e6aea7cbb5722 |
|
MD5 | 7fb2ad39b5031bbd0e2a7bb7f0d018e0 |
|
BLAKE2b-256 | a0cd2235b752791c405ef16e2ecc6580f33f44af4bc8633a74dee09aaa7cb637 |
File details
Details for the file polyglot_piranha-0.3.25-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.11, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88588174eacab4d829cb9e1fa628b94d90ab655f940e5384a3458af1d45c6356 |
|
MD5 | b5aba5c2f174e05136390f293e9618d5 |
|
BLAKE2b-256 | a86afc6ecc36e32bc58228007678659167c3c39b5b84e96d5cf314b165408bf0 |
File details
Details for the file polyglot_piranha-0.3.25-cp310-cp310-manylinux_2_34_aarch64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp310-cp310-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.10, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e05e42c8fe517231490c586f336109f6aef0cfc0cfe635b954190a1617da81f |
|
MD5 | 723c51d9af8723a28522009f658b0f4a |
|
BLAKE2b-256 | 29cfb281c51bbdef3c200860b2964da150b4207e6d88d8d8463fe6f9e7e9790f |
File details
Details for the file polyglot_piranha-0.3.25-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f491d042529a874d1c89272f6cfa0fb2c769e0993c8ccf3eef8bcf1edacf45 |
|
MD5 | 61317e213ed26f70f09655e6235206b3 |
|
BLAKE2b-256 | 6123cefb6fbb86dc9f79c7c9f49748768f5805cedb75585ec7ab83748323343c |
File details
Details for the file polyglot_piranha-0.3.25-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.10, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42d0a5ecea56e7c2aec2c65152061f73f5580c7f2c97d729e5223a8c825ef406 |
|
MD5 | bee2d3ce4f4fc0aced0c07cd671fe397 |
|
BLAKE2b-256 | 767fcbf83f408b913923157031adfed77a77771eaa67904725e591349df86fc8 |
File details
Details for the file polyglot_piranha-0.3.25-cp39-cp39-manylinux_2_34_aarch64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp39-cp39-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.9, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5804040389b1a741a2415ceefabb4f3bab0fc9df9fd469110e9f7b97f58d3c3b |
|
MD5 | f855212a70796406d86d60548d0d6e15 |
|
BLAKE2b-256 | 5745fd40514852c92e7a09e33222f0aaecc864614376df8092ac70a07698dd2f |
File details
Details for the file polyglot_piranha-0.3.25-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f5d6cc7aa1110c0b45ebadeaecdc760acdc786d25c68ec4e93c6ba9f95137df |
|
MD5 | 91e5fa0ca27cca4c4f20a0a3ecfa1d2f |
|
BLAKE2b-256 | 7ed239eea387da2bb910b0b95ffcdd2b2af907e401c07c52a3be85d79de8458b |
File details
Details for the file polyglot_piranha-0.3.25-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.9, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e535ca9d9eb40c7e6b21703449ed954000c5dc3e113dae13ce56b8493f4f7789 |
|
MD5 | 1c5e07963a6eeb66e6a1289387ec8e6d |
|
BLAKE2b-256 | cf108b3d58c823f8175b70f889a8e87077907a81deab75d28fa4d42baffe263e |
File details
Details for the file polyglot_piranha-0.3.25-cp38-cp38-manylinux_2_34_aarch64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp38-cp38-manylinux_2_34_aarch64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.8, manylinux: glibc 2.34+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eefc171cad47848f9b05a0f91d0a9d645d013d98a32210f23e813e6e991429f5 |
|
MD5 | 014215ff5228033219f1bb4e9df78832 |
|
BLAKE2b-256 | efc3e84237d8465cc98e57873e2e9c75935bdb876750cda7eb657d0adfb0df1e |
File details
Details for the file polyglot_piranha-0.3.25-cp38-cp38-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f1f170ef88a8cf9c7724ac7f936085d078fcfd5c8a9e0ebf220b2aa8eff5f3a |
|
MD5 | 62c531615bdc24d9eb775a4a5344ead1 |
|
BLAKE2b-256 | afbc70b812d6a4c78ae79d5bce31b4ac3674e59bdd440b5874ceb90524fb86b8 |
File details
Details for the file polyglot_piranha-0.3.25-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
.
File metadata
- Download URL: polyglot_piranha-0.3.25-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.8, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed47a065bc1c2f3f4550f14c3fdb1950cd757fe236807bc7d53fbb4ffd8b0ea5 |
|
MD5 | d93554fab2e8a3eb36d9259cef5df9f1 |
|
BLAKE2b-256 | faab2a988f1037dbde4664a862523912b20dbf4f1186c88ac36365edeba624b3 |