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:

  • 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.24.tar.gz (154.8 kB view details)

Uploaded Source

Built Distributions

polyglot_piranha-0.3.24-cp312-cp312-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARM64

polyglot_piranha-0.3.24-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (8.1 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.24-cp311-cp311-manylinux_2_28_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.24-cp311-cp311-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARM64

polyglot_piranha-0.3.24-cp311-cp311-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

polyglot_piranha-0.3.24-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (8.1 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.24-cp310-cp310-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

polyglot_piranha-0.3.24-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (8.1 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.24-cp39-cp39-manylinux_2_28_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.24-cp39-cp39-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

polyglot_piranha-0.3.24-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (8.1 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.24-cp38-cp38-manylinux_2_34_x86_64.whl (19.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.24-cp38-cp38-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARM64

polyglot_piranha-0.3.24-cp38-cp38-macosx_10_16_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

polyglot_piranha-0.3.24-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (8.1 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.24.tar.gz.

File metadata

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

File hashes

Hashes for polyglot_piranha-0.3.24.tar.gz
Algorithm Hash digest
SHA256 cc93fba840edefb87793c99a8f781885c56b418f8136cce9cfb2f7de734170e3
MD5 b2d699883468149543e7aec6ef063e87
BLAKE2b-256 7d80b510f856bdc67749531551effcac3c8906a7765edf5e370305b352a7daeb

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: polyglot_piranha-0.3.24-cp312-cp312-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for polyglot_piranha-0.3.24-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1386eb3dcf4cb72ba7b3ea9ad270db0ffb7c40630a789f7fe7e38f0a2ed0e2ae
MD5 75edad2dea1963f089e023fbd7530485
BLAKE2b-256 c1b86a8de5e3b38165dfc8c2faf21f38d7e64b45392c8c8372d5cda39ec820e4

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-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.24-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a8463b64a9a3371799999f631ccaff16dcb15017c04fe9fd083a0eb17ac832a7
MD5 5509796b4da366b4de736531336307eb
BLAKE2b-256 79f2f271eb417ec1e137f8e1ab363fb2b1e4cb0ed3843abd77e6c89eebde51eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.24-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 260e5ce3ed835b1cf0b879d88659fe4060a545ebe8b0ba03e8acc7ac540fe450
MD5 4a9ec8be24a6342ee04fb8d46c08efea
BLAKE2b-256 5fee89c88246afe22d1f9fd2717fd783be33840fd9283fc03c395f177adc4d4d

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: polyglot_piranha-0.3.24-cp311-cp311-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for polyglot_piranha-0.3.24-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 646f4461f67fdef8d93509c7a894ecb36540ab9434a06d2fee70fdca77ce9b08
MD5 1422fc4c28254e245c92c1473ab2dbac
BLAKE2b-256 45c229130ebc0cb541dc51e6e6b67ac3df09fe518a2278c1659268b082b2fd46

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.24-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2cbb45693cf85fdcee2f0f37d695c9531262ce2f610feb5e176924ee018ee596
MD5 09a5e436d69d706c56bbab8fabc1d1aa
BLAKE2b-256 256aae7aee20f4bd40907797af4dd365d841f6b7893990fd96d510942c80ebef

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-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.24-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 9397963d2476c5e1db41c1dd2e3b585cad63a20de5a86c444999d48e4237631c
MD5 a88199c654e1621c10d6651418d4c429
BLAKE2b-256 3a569dd2ccad5c44c2d40754dccd8d21d1fbadc2e4c7fedfc12c2d7dfe8a25fc

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: polyglot_piranha-0.3.24-cp310-cp310-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.10, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for polyglot_piranha-0.3.24-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e0c280766c2b6882fa0578d30de90c02a686954424b75db88a10deb22075af6a
MD5 89a09d8b61d5b21ff465455fa2ff2137
BLAKE2b-256 1822e32e490d2aa00894a669255fecee4e2c0263bf2a864cc6d30826d6cbbacf

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-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.24-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 5ce4ba412c9cd20df2e0594f42177534640a8cf7dd6277e3a861d3c81a1a512a
MD5 bf55648a991056cca1ff8f6a56112593
BLAKE2b-256 8faef5648a4f880e8ae9c4082278e55df24691cdea6f3a4b508d4af6162803ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polyglot_piranha-0.3.24-cp39-cp39-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for polyglot_piranha-0.3.24-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ff0e9b6bb9ee48c89349488542e59914f0aee81eeb8d04ade1ac295c6cd0e969
MD5 4562a936b3189f5e7c04e9a7d40f0362
BLAKE2b-256 93bc54bc3dc39a4e3f9187b44a16b666f974b67c98c199f84d164c9c923b4f4c

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: polyglot_piranha-0.3.24-cp39-cp39-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for polyglot_piranha-0.3.24-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bb1659650aba8cfb1ef402c051f5621d2485f0c9acf28de62cff5b070c666d6e
MD5 b7e3ddccfc1099d5331b41698dcfe7d8
BLAKE2b-256 719185fc7b40e0b41df2416306928636fdbb9a75b5580d90166c00517b7e0ded

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-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.24-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a8f2bb23d2376e9d32d8bd44758553715c8e325e4e070c3d3e881a3115e90d2a
MD5 af9bc7a3b58cefd0094ff9a623d9716e
BLAKE2b-256 cea118241a47101116ae34f96313ca43d77ff91459bead74d74138b19e13e35b

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.24-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ee99ec3a4b930d08fc46be6cc9811431e899bc4f32c2697fe7f7198ee975058d
MD5 db5e34ee6620407a846b0adc74c254a8
BLAKE2b-256 3a96157a755fe21ec75bba34bbd77e48a3b12548024a89476586e1b39310a608

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: polyglot_piranha-0.3.24-cp38-cp38-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.8, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.16

File hashes

Hashes for polyglot_piranha-0.3.24-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ef648998ea7789716d8532628c27a57391cb5a0e13e8ea192e09e2edff242df6
MD5 36b46bd36a92ed76335f58def79d76c7
BLAKE2b-256 99bd69881f3d21d04ed064b5ae4fd9df33ef9c79f67f89c128b62b1a3a50382f

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-cp38-cp38-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.24-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 38a3296a7790fa30a4be20208547d21cf8892643cff756b465ab5c5227dbe40b
MD5 c3ee09b31d37aad12f675285c0e3a9bb
BLAKE2b-256 4eb6b6e101a4de92194cf66308a2ce2fb2da7728027ae137313886d468c84da7

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.24-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.24-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 9580fd337b491cf016d0592f5e3122b7b4d82a0505a32f5d7e9b409365e154cd
MD5 1669c503db366fc6ed4c9fc9c7e0025b
BLAKE2b-256 cc7e5ab841b9496be6c3eef2790555d000bb64cd9f35aaeae0985d22db746c7c

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