Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- exclude unmodified lines from the diff context by searching for lines which explicitly start with + or -, meaning added/removed lines. This will prevent the script to trigger when adding/modifying other constants in the vicinity of the ones that we check for! - as an extra measure search only for modified lines which also contain the word "const" inside of them! This will prevent the script to trigger when modifying function calls which merely use the value of the constants that we check for! - as more extra measure examine diff only on the runtime/ directory to avoid triggering by changes in this script itself or other files which may be referencing a constant name, e.g. text documentation. NOTE: the script can still trigger with a false positive if for example you modify a definition for a different constant, whose value is an expression consuming the constants we check for. For example: -const CTC_REWARD_PER_BLOCK: Balance = 2 * CTC; +const CTC_REWARD_PER_BLOCK: Balance = 2 * CTC * EPOCH_DURATION_IN_BLOCKS; will trigger the script! Improve by diffing only runtime/
- Loading branch information