You are technically responsible for the code violations until the title to the house transfers, either to the lender or a third party.Since you were unaware of the violations, I assume that the city was never informed of the bankruptcy.  Technically, you can not discharge civil or criminal penalties.  However, in my practice, I have found that be sending notice of the bankruptcy to the city will cease collection efforts.  Whether it helps your credit report is a different matter.The fact that you are out of state and no longer residing there is irrelevant.