summaryrefslogtreecommitdiff
path: root/lib/declarative_policy
Commit message (Collapse)AuthorAgeFilesLines
* Enable more frozen string in lib/**/*.rbgfyoung2018-10-0610-1/+22
| | | | | | | | | | | | | Enables frozen for the following: * lib/*.rb * lib/banzai/**/*.rb * lib/bitbucket/**/*.rb * lib/constraints/**/*.rb * lib/container_registry/**/*.rb * lib/declarative_policy/**/*.rb Partially addresses #47424.
* Resolve Naming/UncommunicativeMethodLin Jen-Shin2018-07-097-28/+28
|
* Resolve "Make a Rubocop that forbids returning from a block"🙈 jacopo beschi 🙉2018-04-181-1/+1
|
* [CE] Add Naming/FileName rule checking expected class/module per filenameGabriel Mazetto2018-03-085-104/+106
|
* Adds Rubocop rule for line break after guard clauseJacopo2017-11-164-0/+10
| | | | Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
* Speed up cached_pass? for composite rulesSean McGivern2017-10-051-8/+12
| | | | | | Both `Or` and `And` would evaluate whether each rule passed, then calculate a value based on the results of all of those. We can actually return early in many cases, without running the rule at all.
* Speed up DeclarativePolicy::Runner#steps_by_scoreSean McGivern2017-10-041-11/+20
| | | | | | | | | | | | | | | There were a couple of things here: 1. If the state was already enabled, we don't need to check all the remaining steps - only those that can prevent the state. (An enable followed by an enable is a no-op.) This logic is in `#run`, but we still did the work of scoring and sorting the steps. 2. The sorting is known to be inefficient, but we can make it slightly more efficient by stopping once we have a step with zero score, as that means it's free. Neither of these make this _fast_, especially when called lots of times - as we do when there is lots of activity on an issue - but they do help some.
* Merge branch 'rs-more-public-send-whitelists' into 'master'Rémy Coutable2017-08-162-2/+2
|\ | | | | | | | | Whitelist or fix additional `Gitlab/PublicSend` cop violations See merge request !13467
| * Whitelist or fix additional `Gitlab/PublicSend` cop violationsrs-more-public-send-whitelistsRobert Speicher2017-08-142-2/+2
| | | | | | | | | | An upcoming update to rubocop-gitlab-security added additional violations.
* | Enable Layout/TrailingWhitespace cop and auto-correct offensesRobert Speicher2017-08-151-1/+1
|/
* more eagerly bail when the state is preventedhttp://jneen.net/2017-08-071-4/+3
|
* reduce iterations by keeping a count of remaining enablershttp://jneen.net/2017-08-071-1/+4
| | | | | rather than iterating the whole remaining step set with .all?(&:prevent?)
* cache the cache key...perf/policy-class-cachehttp://jneen.net/2017-07-171-7/+8
|
* avoid #respond_to? in Cache.id_forhttp://jneen.net/2017-07-171-5/+8
|
* add a new DeclarativePolicy frameworkhttp://jneen.net/2017-06-278-0/+1162