Commit graph

19 commits

Author SHA1 Message Date
GitLab Bot
c6c7437861 Add latest changes from gitlab-org/gitlab@master 2020-03-04 12:07:52 +00:00
GitLab Bot
3f9e1b2611 Add latest changes from gitlab-org/gitlab@master 2020-01-23 15:08:46 +00:00
Stan Hu
f93b2e02a5 Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
Andrew Newdigate
3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00
gfyoung
d598e4fd93 Enable more frozen string in lib/**/*.rb
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.
2018-10-06 17:02:50 -07:00
Lin Jen-Shin
3bfe306624 Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
🙈 jacopo beschi 🙉
c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
Gabriel Mazetto
5c7a738105 [CE] Add Naming/FileName rule checking expected class/module per filename 2018-03-08 12:56:54 +00:00
Jacopo
181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Sean McGivern
e9476eb97a Speed up cached_pass? for composite rules
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.
2017-10-05 10:12:58 +01:00
Sean McGivern
d771719278 Speed up DeclarativePolicy::Runner#steps_by_score
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.
2017-10-04 13:50:05 +01:00
Rémy Coutable
fcce6c3168 Merge branch 'rs-more-public-send-whitelists' into 'master'
Whitelist or fix additional `Gitlab/PublicSend` cop violations

See merge request !13467
2017-08-16 11:25:26 +00:00
Robert Speicher
4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Robert Speicher
260c8da060 Whitelist or fix additional Gitlab/PublicSend cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00
http://jneen.net/
15bb6e1ed7 more eagerly bail when the state is prevented 2017-08-07 12:48:22 -07:00
http://jneen.net/
8a167554a9 reduce iterations by keeping a count of remaining enablers
rather than iterating the whole remaining step set with
.all?(&:prevent?)
2017-08-07 12:36:13 -07:00
http://jneen.net/
fcd3e5d477 cache the cache key... 2017-07-17 14:38:48 -07:00
http://jneen.net/
45e9d28791 avoid #respond_to? in Cache.id_for 2017-07-17 14:38:48 -07:00
http://jneen.net/
80d6e5bbd4 add a new DeclarativePolicy framework 2017-06-27 12:41:54 -07:00