Prevent directory permissions of sites/default from being protected in a local environment? Drupal automatically changes the directory permissions of sites/default to 555 (i.e. read-only), which means that if I'm editing sites/default/settings.php, even if I've set the permissions for that file to read/write (which it again reverts on a page load), PhpStorm still gives me a permission denied error on the swap file it's attempting to create in the same directory.


Is there a more flexible way to update settings (especially on
a dev machine) other than manually setting the file and directory
permissions every time you need to edit those files?   
Do I just have to do it via sudo?
Can I disable permissions checking for a specific environment?
If you are on Drupal 8, you can configure settings.php to include a settings.local.php with a simple environment check (to ensure you are running a local env).

In that file, you can add this:

$settings['skip_permissions_hardening'] = TRUE;

This will allow you to open and write to settings.php without it being locked back down.